About
About
Copy-paste jq one-liners — by someone who pipes JSON through the terminal all day and got tired of re-deriving the same filters.
jq is the standard tool for slicing JSON on the command line, but its syntax is dense and easy to
forget between uses. This site collects the filters that actually come up — filtering an array of
objects, reshaping with map(), building new objects, grouping, turning JSON into CSV —
into one library. Each recipe shows the filter, sample input, and the exact output, so you can verify
it before running it on your own data.
Recipes target jq 1.6 and 1.7+, and note when a builtin is version-specific. Every snippet is the
plain jq filter — pipe it after cat file.json or curl -s URL.
Topics: install, accessing fields, iterating, select() filtering, map()
transforms, object construction, sort/unique/group, CSV/TSV output, raw strings, and
--arg/slurp/recursive descent.