Pretty Print JSON responses from `curl` - Part 2
After posting my last TIL , Vinicius showed me another tool that goes beyond just pretty printing: jq
If you don't pass any args to jq
it will just pretty print same as json_pp
:
What if you only want to display the first post on the response? Just pass an argument to filter the keys you want. It's like Xpath for JSON: jq '.data.posts[0]'
See Part 3
Tweet