jq - The JSON processor

jq is like sed for JSON data - It can be used to slice, filter, map and transform structured data with the same ease that sed, awk, grep and friends let you play with text.


JSON is one of the most popular text, human-readable file formats. It's popularity derives from the fact that it is very flexible. It is basically based on the two powerful concepts of lists and dictionaries, which allow to represent complex structured data in a simple way. It is also more compact than alternatives such as XML.

However, given the structured nature of JSON, it is hard to impossible to handle using traditional command line tools. jq provides a comfortable syntax to access the various elements of a JSON text, and prints the results to the standard output. Its output can be further managed as JSON text.

Various operators can be applied to manipulate the data before printing.

Overall, jq is a very sophisticated tool to manage JSON data, which is very handy when the JSON format is in use.


References