4 ms·
At my job I have to work with a lot of JSON that's usually minimized. This command has single-handedly saved my sanity: $ pbpaste | jq | pbcopy Then I can pa
by pak9rabid 2y ago
At my job I have to work with a lot of JSON that's usually minimized. This command has single-handedly saved my sanity:
$ pbpaste | jq | pbcopy
Then I can paste it into whatever text editor I want and it's all nice & pretty-printed for me.
Bonus is that I don't have to change the command at all, just copy the minimized JSON to the clipboard (say from DBeaver, for example), then hit the 'up' arrow and enter.
- mfonda 2y agoI never knew that jq without any arguments pretty-printed JSON. Very useful, and great tip to combine with pbcopy/pbpaste.