JSON jamming in the new age

Nowadays, JSON is everywhere, in web apis, in configuration files, even in logs. JSON is the default format used to structure data. Because it is used so much, there will be times when we will need to process JSON from the command line. Could you imagine doing this with grep, sed, or other conventional tools? That would be quite a challenge.

Luckily for us, there is a simple Command-line tool called jq that we can use to query JSON files. It comes with its own language syntax, as we will see in just a few minutes.

First let's install jq with the following command:

sudo apt install jq
JSON jamming in the new age

Now let's use an example file, a dummy ...

Get Working with Linux – Quick Hacks for the Command Line now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.