json - pretty-print a JSON file with syntax-coloring and indentation
$ json [options...] [path...]
json
pretty-prints a JSON file with syntax-coloring and indentation.
If no path argument is provided stdin is used.
--help
: Display this message-i
, --indent-size
: Size of indentations in spaces-q
, --query
: Dotted query keypath
: file to pretty-print# Pretty-print stdin
$ cat /sys/kernel/processes | json
# Pretty-print a file
$ json json-data.json
# Pretty-print a file with two spaces per indent
$ json -i 2 json-data.json
# Query data from JSON
$ json -q 1 .config/CommonLocations.json
$ cat /sys/kernel/processes | json -q processes