News for hackers. Stuff that matters.
Re:Useful built-in macOS command-line utilities by pak9rabid on Wednesday November 06, 2024 @11:53AM (#42065164)
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.

Re:Useful built-in macOS command-line utilities by mfonda on Wednesday November 06, 2024 @01:25PM (#42066850)
I never knew that jq without any arguments pretty-printed JSON. Very useful, and great tip to combine with pbcopy/pbpaste.