Skip to content

Instantly share code, notes, and snippets.

@ipan
Last active January 16, 2018 06:33
Show Gist options
  • Save ipan/5616c3e7c6d250986731d146c017a321 to your computer and use it in GitHub Desktop.
Save ipan/5616c3e7c6d250986731d146c017a321 to your computer and use it in GitHub Desktop.
formatting json files with jq #json #jq
# jq can not write back to the same file
for i in `find . -name '*.json'`
do
jq '.' $i > $i.tmp
mv $i.tmp $i
done
# oneliner version
# for i in `find . -name '*.json'`; do jq '.' $i > $i.tmp && mv $i.tmp $i; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment