Use python to pretty print JSON on command line using json std library module
python -m json.tool
Example:
echo '{"foo": "bar", "baz": [1, 2, 3]}' | python -m json.tool
Output:
{
"foo": "bar",
"baz": [
1,
2,
3
]
}
Top comments (0)