Inspecting JSON output in the command line

Example image

View JSON output in the command line using jq together with less. This makes JSON output more readable.

Setting it up

Use jq with less to make view JSON output better. Using -C with jq will force colors, and -R with less will print colors.

# For bash and zsh shells
alias jless='jq -C . | less -R"
# For fish shell
abbr jless 'jq -C . | less -R"

Usage example

Use this jless alias to make better sense of Docker's output:

docker ps --format '{{ json . }}' | jless