cheat/cheat/cheatsheets/jq
2015-05-20 01:45:52 +05:30

14 lines
177 B
Plaintext

# Pretty print the json
jq "." < filename.json
# Access the value at key "foo"
jq '.foo'
# Access first list item
jq '.[0]'
# Slice & Dice
jq '.[2:4]'
jq '.[:3]'
jq '.[-2:]'