jq
๐งน
JSON formatter/prettifier.
๐ https://stedolan.github.io/jq/
๐ https://github.com/stedolan/jq
Installation (on Debian)
sudo apt-get install jq
Format/prettify
echo -n '{"who":["me","you"],"when":"now"}' | jq
{ "who": [ "me", "you" ], "when": "now" }
Indentation with tab --tab
echo -n '{"who":["me","you"],"when":"now"}' | jq --tab
Compact -c
cat << EOF | jq -c
{
"who": [
"me",
"you"
],
"when": "now"
}
EOF
{"who":["me","you"],"when":"now"}
Sort keys -S
echo -n '{"z":"z","a":"a"}' | jq -S
{ "a": "a", "z": "z" }
Uncolorize output (monochrome) -M
echo -n '{"who":"me","when":"now"}' | jq -M
Top comments (0)