jq
A command-line JSON processor.
jq filters, transforms, and pretty-prints JSON from the command line. Its query language is small but expressive — a path expression like .users[].email reaches deep into nested structures, and transformations like map(select(.active)) combine with map and length to produce summary aggregates. The language has lazy semantics and supports streaming for very large inputs.
Stephen Dolan released jq in 2012, and it has since become the de facto standard JSON processor for shell pipelines. The official implementation is in C; a project called gojq provides a Go reimplementation with most of the same semantics, and yq (in Go) extends jq's language to YAML and other formats.
jq is everywhere on modern Linux systems: in CI pipelines that need to read GitHub or GitLab API responses, in shell scripts that consume kubectl or aws JSON output, and in ad-hoc command- line work that needs to extract a field from a curl response. It is the tool people reach for when they need "structured grep" for JSON.
Install
Debian/Ubuntu: sudo apt install jq Fedora/RHEL: sudo dnf install jq Arch: sudo pacman -S jq macOS: brew install jq
Authors
- Stephen Dolan (creator)
- jq maintainers