How can I pretty-print JSON? Feb 9, 2015 echo '{"foo": "lorem", "bar": "ipsum"}' | python -m json.tool http://stackoverflow.com/a/1920585/1133742