Pretty printing json

Here is a really simple way to pretty print some unformatted json

$ echo '{"foo": "lorem", "bar": "ipsum"}' | python -mjson.tool  
{  
    "bar": "ipsum",  
    "foo": "lorem"  
}
This entry was posted in bash, python. Bookmark the permalink.

Comments are closed.