jq is a lightweight commandline JSON processor and works well!
for this you need to install jq with the command below(if you are using apt package manager).
sudo apt-get install jq
Below command will pretty json to a new file.
jq '.' non-pretty.json > pretty.json
Also we can filter the json with jq, I found it to be very helpful while working with large geojson files, for instance below command will save only properties of first feature.
jq '.features[0].properties' geojson_file.json > pretty.json
Hope this will be helpful!