mirror of
https://github.com/Erreur32/cheat.git
synced 2024-11-16 08:58:35 +01:00
14 lines
177 B
Text
14 lines
177 B
Text
|
# 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:]'
|