jq: command-line JSON processor
jq is a small command-line tool for reading, filtering and transforming JSON, like sed and awk for structured data.
Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?
jqlang/jq
- Stars
- 36.5k
- Forks
- 2.3k
- Language
- C
- Licence
- NOASSERTION
- Last push
- 1 Dec 2026
On GitHub: Command-line JSON processor
Open on GitHubAPIs, cloud CLIs and config files all speak JSON, and grep is a poor fit for nested data. jq takes JSON on stdin and applies a filter to it. The simplest filter, ., just pretty-prints the input: curl -s https://api.github.com/repos/jqlang/jq | jq .. From there you pick fields with .name, walk arrays with .[], and chain steps with | inside the filter.
A few patterns cover most needs: jq -r '.items[].name' prints raw strings without quotes, jq '.[] | select(.status == "failed")' filters objects, jq '{id, title}' builds a smaller object, and jq length counts elements. Use --arg name value to pass shell variables in safely instead of pasting them into the filter string.
jq is a single dependency-free binary, packaged for all major systems. The repository moved from its original owner to the jqlang organization, which maintains it today; the manual on the project site documents the full filter language.
Did this work for you?
No votes yet. Be the first.
If it did not work, the report form below tells the editors what went wrong.
See also
- 0057 Shell cheat sheet: everyday commands A quick reference for moving around, managing files, viewing and searching text, checking processes and disk space in bash and zsh, with… Beginner · Cheat sheet · Linux, macOS Article Basics · Command-line tools 15 Oct 2026
- 0076 jq recipes: 23 one-liners for JSON on the command line A runnable collection of jq filters for everyday JSON work: pick fields, filter with select, reshape, sort, count, group, pass shell variables,… Intermediate · Cheat sheet · Linux, macOS, Windows Script Command-line tools · jq & JSON on the command line 15 Oct 2026
- 0392 Install Visual Studio Code on Linux, macOS and Windows Install VS Code from Microsoft's packages, Homebrew or winget, get the code command working in the terminal, and add the extensions you… Beginner · Step by step · Linux, macOS, Windows Article Command-line tools · Installing languages & tools 15 Oct 2026
- 0421 grep, sed, awk and jq: the four text tools you will use every week A working reference for the four commands that handle most text on the command line: grep finds lines, sed edits them, awk… Intermediate · Cheat sheet · Linux, macOS Article jq & JSON on the command line · Modern command-line tools · Text processing 15 Oct 2026
- 0425 jq cheat script: pretty-print, filter and flatten JSON from a file or stdin A small read-only bash wrapper around jq with the recipes you keep looking up: pretty, compact, sorted keys, list paths, pick fields,… Beginner · Cheat sheet · Linux, macOS Script jq & JSON on the command line · Modern command-line tools · Text processing 15 Oct 2026
History
Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.
- Dominik +917 chars