pretty print json in command line code example
Example 1: print json pretty linux
echo '{"foo": "lorem", "bar": "ipsum"}' | python -m json.tool
Example 2: pretty print json in console
new JSONObject(json).toString(2)
echo '{"foo": "lorem", "bar": "ipsum"}' | python -m json.tool
new JSONObject(json).toString(2)