I am not the first to discover jq, or even to write about it. However, jq was such a valuable tool for me that I felt obliged to share it with you. And turn it into a Katacoda scenario (Katacoda is on of my other favorite finds).
jq is a Linux command line utility that is easily used to extract data from JSON documents. The source of a JSON document can be a response from a CLI command or the result of a REST API call, files retrieved from remote locations or read from local storage. jq allows us to easily retrieve specific values from the JSON sources, store them in Shell variables and use them in scripts.
Play with jq in this Katacoda scenario: https://katacoda.com/lucasjellema/scenarios/jq-intro – that is also embedded at the end of this article.
- jq on GitHub – https://stedolan.github.io/jq/
- JQ Tutorial – https://stedolan.github.io/jq/tutorial/
- jqplay.org – live playground for jq – https://jqplay.org/
- Introduction of jq as Bash command – https://linuxhint.com/bash_jq_command/
Guide to Linux jq Command for JSON Processing – Baeldung- https://www.baeldung.com/linux/jq-command-json
- Cookbook – https://github.com/stedolan/jq/wiki/Cookbook
2 thoughts on “jq – Linux command line tool for interpreting and manipulating JSON documents”
Thank you for the nice tutorial Lucas!
FYI, this works nicely in a terminal window on MacOS as well: “brew install jq”
(on the other hand, use Chrome to follow the tutorial as Safari is not too happy with it) /Demed
Hi Demed, Thanks – glad you like it. kind regards,Lucas