jq Command Guide: Filter and Transform JSON
Master jq for JSON processing on the command line. Filter, map, reduce, and transform JSON data with select, map, group_by, and custom functions.
Published:
Tags: developer-tools, cli, json
jq Command Guide: Filter and Transform JSON on the Command Line is a command-line JSON processor. If you work with APIs, Kubernetes, AWS CLI, or any JSON-emitting tool, learning jq properly cuts out a lot of Python/Node scripts you'd otherwise write just to extract a field. This guide assumes you have jq installed ( on macOS, on Debian/Ubuntu). --- The Dot Filter — Your Starting Point Every jq expression starts with which means "the entire input." Array access: --- Pipes and Object Construction Pipe jq filters with (same idea as shell pipes, but inside jq): Build new objects with : --- map and select — Filtering Arrays applies a filter to every element of an array. keeps only elements where the condition is true. Real-world example — filtering a list of GitHub issues: --- Useful Built-in…
All articles · theproductguy.in