Skip to content
_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN DE
Let's talk

jq — JSON Processing on the Command Line

07. 08. 2025 Updated: 24. 03. 2026 1 min read intermediate

jq — JSON Processing on the Command Line

JSON is everywhere — APIs, configuration files, logs. jq is like sed/awk for JSON — it filters and transforms data right from the terminal.

Basics

sudo apt install jq echo ‘{“name”:”test”,”value”:42}’ | jq ‘.’

Filtering

curl -s api/data | jq ‘.results[0].name’ jq ‘.[] | .email’ users.json jq ‘.[] | select(.age > 30)’ users.json jq ‘.[] | {name: .name, email: .email}’ users.json

Transformation

jq ‘{hostname: .name, cores: .cpu}’ server.json jq -r ‘.[] | [.name, .email] | @csv’ users.json jq -s ‘.[0] * .[1]’ defaults.json overrides.json

Aggregation

jq ‘.users | length’ data.json jq ‘[.[] | .price] | {min: min, max: max, avg: (add / length)}’ products.json jq ‘[.[] | .category] | unique’ products.json

Examples

curl -s ‘https://api.github.com/users/torvalds/repos’ | jq ‘.[] | {name, stars: .stargazers_count}’ kubectl get pods -o json | jq ‘.items[] | select(.status.phase != “Running”) | .metadata.name’ cat app.log | jq -c ‘select(.level == “error”) | {time: .timestamp, msg: .message}’

jq is Essential

For API and JSON data, jq dramatically speeds up your workflow.

jqjsonclilinux
Share:

CORE SYSTEMS team

We build core systems and AI agents that keep operations running. 15 years of experience with enterprise IT.