JSON is a commonly used format for data transmission, especially with Ajax calls. It's more structured and easier to process then XML, but could be just a wall of text depending on the creator. This oneliner reformats JSON to look pretty and human-readable.
I've to write a script which outputs a JSON in the same structure as an existing file, but I need to understand the current structure before starting with the script. The existing file is valid JSON but hard to read, because it has no indention or newlines. I can't paste it into an online JSON-beautifier, because it contains company secrets and passwords. But Perl's JSON module provides an easy way for reformating:
perl -MFile::Slurp -MJSON -le '$j = JSON->new; $j->pretty(1); print $j->encode($j->decode(read_file($ARGV)));' my_file.jsonPerl is being called and instructed to load two modules: File::Slurp for reading the input file and JSON for parsing and writing the JSON-Format. A new JSON object is created and configured to output pretty JSON code. Finally, the file is being read, decoded from JSON into a Perl datastructure and encoded as (pretty) JSON.