The python utils section missed the very cool json.tool that can pretty print JSON files (and exists on your OS if it includes Python): cat /tmp/foo.json | python -m json.tool https://docs.python.org/3/library/json.html#module-json.tool
Don't abuse cats, use `python3 -m json.tool < test.json` instead.
> Characters saved with " Hours lost with accidental ">"? unbounded.
Preface: I'm confident on the shell & with my keyboard: I've been using shell redirects for a couple decades, learned touch-typing up to around 80WPM, and used to note-take math lectures live in latex. Yes, I have noclobber enabled. But...
I can't promise myself I'm on a machine configured that way OR that I won't typo this one on a file that really matters.
I kinda use of `cat` as a `immutability-please` command: it _creates_ a barrier/seam between this file and whatever I'm doing with it, such that I'm _guaranteed_ nothing downstream will mutate it (as long as everything only works on stdio).
In a kinda similar way: by starting with `cat x |` (or even just `cat x`, frequently!), the rest of that compound command is _input source independent_ (and even _ignorant_!) -- if I want to hook it up later to a `curl example.com/xyz.json`, I don't need to split it into separate commands/introduce temp files/etc. This is especially because I find myself doing a _really_ quick scan of the entire file ("did it return the actual object this time or just `{}`?"), then piling on transforms from there.
Something about doing `cat x | head` and then kill-wording to fill in `next-thing` feels faster and more consistent than `head x` and then `next-thing x`, maybe because the filenames are often much longer than the commands? Maybe I need a "go to start of line, forward-kill one word" hotkey?
tl;dr: i'm playing psychological games with myself and TBH not sure I'm coming out ahead.