Skip to content

Instantly share code, notes, and snippets.

@phdesign
Created May 28, 2019 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phdesign/6394cf2d2525701de4f456553323b8ef to your computer and use it in GitHub Desktop.
Save phdesign/6394cf2d2525701de4f456553323b8ef to your computer and use it in GitHub Desktop.
Sort JSON properties on the command line using python
cat /dev/clipboard | python -c 'import json, sys; json.dump(json.load(sys.stdin), sys.stdout, indent=4, sort_keys=True);'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment