Friday, December 28, 2012

Pretty priting json from command line


alias pp='python -mjson.tool'

http://ruslanspivak.com/2010/10/12/pretty-print-json-from-the-command-line/

Simple json parser for bash using python

echo $YOUR_JSON_DATA | python -c "import json; import sys; data=json.load(sys.stdin); print data['results']"

 

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.