Pretty-Print JSON from the Command Line
Python includes a built-in tool for pretty-printing JSON. You can use it like this:
cat file.json | python -m json.tool
Or create a convenient alias for the command:
alias json="python -m json.tool"
Now you can simply do:
cat file.json | json
Written by Tyler Hunt
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#