Skip to content

Instantly share code, notes, and snippets.

@sajadtorkamani
Last active July 27, 2018 09:13
Show Gist options
  • Save sajadtorkamani/e88dcc66e9539f7ae3240e0ce0ee2a7f to your computer and use it in GitHub Desktop.
Save sajadtorkamani/e88dcc66e9539f7ae3240e0ce0ee2a7f to your computer and use it in GitHub Desktop.
Pretty print CURL JSON output with jq

Install jq package

sudo apt-get install jq

Output all results

curl <url> | jq

Output only certain fields

curl <url> | jq '{<fieldA>, <fieldB>}'

Convert output to array

curl <url> | jq '{<collectionField>[]}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment