/ Linux

JQ

Introduction

JQ is a stream editor like sed, but specialized in json.

Just some_command_with_json_output | jq will already give you a nicely formated and colored output.

Install

sudo apt install -y jq || yum install -y jq

Examples

Get all my public repositories from Github, then list URLs if repository's name start with ansible-role

curl -s https://api.github.com/users/rgarrigue/repos | jq '.[] | select(.name | startswith("ansible-role")) | .html_url'
JQ
Share this