Skip to content

Instantly share code, notes, and snippets.

@vdel26
Created October 28, 2013 15:35
Show Gist options
  • Save vdel26/7199012 to your computer and use it in GitHub Desktop.
Save vdel26/7199012 to your computer and use it in GitHub Desktop.
XML and JSON command line pretty printing
# XML (requires libxml2)
echo '<root><foo a="b">lorem</foo><bar value="ipsum" /></root>' | xmllint --format -
# JSON (requires python)
echo '{"foo": "lorem", "bar": "ipsum"}' | python -mjson.tool
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment