mirror of
https://github.com/cheat/cheat.git
synced 2025-04-16 14:36:07 +02:00
jq is a command line json processor
Here is the awesome manual: http://stedolan.github.io/jq/manual/
This commit is contained in:
parent
417f47f037
commit
434802341e
13
cheat/cheatsheets/jq
Normal file
13
cheat/cheatsheets/jq
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# 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:]'
|
Loading…
x
Reference in New Issue
Block a user