formatting or parse json in command line
To easily format json or command line there jq​
example
1
$ echo '{"user":"stedolan","titles":["JQ Primer", "More JQ"]}' | jq .
2
{
3
"user": "stedolan",
4
"titles": [
5
"JQ Primer",
6
"More JQ"
7
]
8
}
Copied!
or just print specific value
1
$ echo '{"user":"stedolan","titles":["JQ Primer", "More JQ"]}' | jq .titles[0]
2
"JQ Primer"
Copied!
Last modified 1mo ago
Copy link