Skip to content

Instantly share code, notes, and snippets.

@korneliakobiela
Last active July 11, 2017 07:43
Show Gist options
  • Save korneliakobiela/044e56d393bcac024cdf3b92a802b085 to your computer and use it in GitHub Desktop.
Save korneliakobiela/044e56d393bcac024cdf3b92a802b085 to your computer and use it in GitHub Desktop.
Colorfull and well formated json output from CURL in Linux

Colorful and pretty json output from CURL on Debian-based Linux

Requirements:

Install python 2.7, pip, and pygments.

sudo apt install python python-pip
sudo pip install pygments

Configuration:

Open file ~/.bashrc into your favorite text editor

vim ~/.bashrc

Go to the end of document and write:

alias json='python -m json.tool | pygmentize -l json'

Save and close document. Then type into your terminal:

source ~/.bashrc

Usage:

curl request_data | json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment