Skip to Content
Working with Linux ??? Quick Hacks for the Command Line
book

Working with Linux ??? Quick Hacks for the Command Line

by Petru I»ôfan, Bogdan Vaida
May 2017
Beginner
222 pages
3h 50m
English
Packt Publishing
Content preview from Working with Linux ??? Quick Hacks for the Command Line

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Basic Linux Terminal Tips and Tricks: Learn to Work Quickly on the Command Line

Basic Linux Terminal Tips and Tricks: Learn to Work Quickly on the Command Line

Philip Kirkbride
Windows Registry Troubleshooting

Windows Registry Troubleshooting

MVP Mike Halsey, MVP Andrew Bettany

Publisher Resources

ISBN: 9781787129184