python -c "import sys, json; print json.dumps(json.load(sys.stdin),sort_keys=True, indent=0)" < json_file python -c "import sys, json; print json.dumps(json.load(sys.stdin),sort_keys=True, indent=0)" < json_file | tr -d "\n"