diff --git a/cheat/cheatsheets/jq b/cheat/cheatsheets/jq new file mode 100644 index 0000000..d57cc13 --- /dev/null +++ b/cheat/cheatsheets/jq @@ -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:]'