Skip to content

Instantly share code, notes, and snippets.

@stekern
Created November 12, 2020 07:50
Show Gist options
  • Save stekern/ab246c96e9f3b350c405c6cbad0ee3dc to your computer and use it in GitHub Desktop.
Save stekern/ab246c96e9f3b350c405c6cbad0ee3dc to your computer and use it in GitHub Desktop.
Shell one-liner for pretty-printing JSON
python -c "import sys; import json; j = json.load(sys.stdin); json.dump(j, sys.stdout, indent=2, sort_keys=True, separators=(',', ': '))"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment