It doesn't have to be a one size fits all solution, there are edge cases where json wouldn't be the right choice, but for many and most things i could think of that i use daily I'd be happy with json. If it's small binary data i guess it could be base64 encoded.
Querying network interfaces, directories, process information, systemd daemons or anything else, i see these things could do great if they just outputted json and my shell could treat it as an object. If a script is performance critical, maybe it's time to rewrite it in another language anyways?
any tool that outputs json + jq => instant scriptability win.
Eg I have a script that needs output from netstat, and `netstat -bin --libxo json | jq ...` is a great way to get that info instead of scraping the human-readable output.
FYI, `jc netstat` also generates JSON output for `netstat`.
(disclosure: I'm the author of `jc`)
While I'm at it... check out `jtbl` on my github which prints the JSON or JSON Lines output to a table in your terminal.
It's not the answer for everything, it's just one of the tools. It feels cosy to huge amount of people because it's the product of web explosion, but at the core it's accidental and not that good.
curl -I -XGET -w '%{json}' https://www.google.com | tail -1 | jq
-o /dev/null