← Back to Docs
Recipe
jq Cookbook
Practical jq recipes for slicing, dicing, and transforming JSON at the command line.
Pretty-print with color
cat data.json | jq .Extract a single field
jq '.name' data.jsonFilter array elements
jq '.[] | select(.status == "active")' data.jsonMap and transform
jq '.[] | {id, label: .name}' data.jsonGroup by a key
jq 'group_by(.category)' data.jsonMerge two JSON files
jq -s '.[0] * .[1]' a.json b.jsonWant more? Check the full docs index for advanced filtering, regex matching, and CSV export recipes.