From 434802341e36ada35eeec4e60147a502bd20f910 Mon Sep 17 00:00:00 2001 From: Shadab Zafar Date: Wed, 20 May 2015 00:17:55 +0530 Subject: [PATCH] jq is a command line json processor Here is the awesome manual: http://stedolan.github.io/jq/manual/ --- cheat/cheatsheets/jq | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 cheat/cheatsheets/jq 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:]'