Skip to content

Instantly share code, notes, and snippets.

@phdesign
Created May 28, 2019 19:15
Show Gist options
  • 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