Linux Commands Reference - Complete Linux Command Guide

Comprehensive Linux command reference with 150+ commands. Search, filter by category, and view detailed usage examples.

Share
Back to commands

jq

Command-line JSON processor

Syntax

jq [OPTION]... FILTER [FILE]

Common Options

.Pretty print JSON
-rRaw output (no quotes)
-cCompact output
-eExit with error if no result
-nDon't read input
-SSort keys in output
-fRead filter from file

Common Examples

jq . file.json

Pretty print JSON

jq '.name' file.json

Extract field

jq '.[0].name' file.json

Extract name from first array element

jq '.[] | select(.age > 18)' file.json

Filter array

curl -s URL | jq .

Format API response

jq -r '.items[].name' file.json

Extract multiple values raw

Related Commands

Related Tools

More Code & Dev Tools