Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active February 3, 2026 20:19
Show Gist options
  • Select an option

  • Save dacr/1c9b53be1d40c5a6bf415ea0eafdc99c to your computer and use it in GitHub Desktop.

Select an option

Save dacr/1c9b53be1d40c5a6bf415ea0eafdc99c to your computer and use it in GitHub Desktop.
jq cheat sheet / published by https://github.com/dacr/code-examples-manager #f3343d02-5885-4a13-8800-c01754abd0d0/3a0db760d40a33804d0cb614f41e831f4156be99

jq cheat sheet

extract some fields of objects contained in an array

echo '[{"a":1,"b":2,"c":3},{"a":10,"b":20,"c":30}]' | jq '.[] | .a, .b'

Notes:

  • use -r to get raw results without quotes for example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment