Pretty-print JSON with indentation and colors
pretty print json command line | format json file linux | validate json in terminal | jq | json | formattingjq . composer.jsonThe . filter outputs the complete document unchanged, but neatly indented. If the JSON is invalid, jq reports the position with line and column and exits with an error code. Works just as well in a pipe, for example curl -s https://example.com/wp-json/ | jq ..
Note: jq is not preinstalled: apt install jq. Conversely, -c produces compact single-line JSON.
Also searched as
- pretty print json command line
- format json file linux
- validate json in terminal