Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

May 142011

How to format a JSON file using command line


JSON (JavaScript Object Notation) is a very popular data exchange format nowadays and to pretty format (i.e. easy to read) a JSON file, you can use the following method:

# cat my.json | python -mjson.tool

That's all.

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>