curl and jq 8 · jq: filter and transform JSON
Pass a shell variable
Use a shell value inside a jq filter without quoting problems.
jq --arg name "Ada" '.users[] | select(.name == $name)' data.json
Official curl and jq 8 documentation
More jq: filter and transform json commands
- Pretty-print JSON
- Get a field
- Get a field without quotes
- Iterate over an array
- Get a field from each element
- Filter elements
All jq: filter and transform json commands · curl and jq 8 cheatsheet