Install JQ on Linux

Install JQ on Linux

I stumbled upon JQ a few days ago while working with awk, grep, and sed. It is similar to these tools, with the exception for that it is specifically written to parse JSON. Today we will cover a small guide on how to install this on various flavors of linux. If you prefer the source or want to install it on Windows, see this page.

CentOS:

yum install jq

Debian and Ubuntu:

sudo apt-get install jq

In future tutorials I will be incorporating the use of jq. Below is an example of it in use with the AWS CLI.

I would run the below command (I have included the output as well), the first part will pull all of the hosted zones from Route53, after the vertical pipe jq will output raw strings, not JSON texts (-r), and we will drill down for each instance of “Name” under “HostedZones”. This will list all of the domains we have Hosted Zones for.

aws route53 list-hosted-zones | jq -r ".HostedZones[].Name"
xennetworks.com.
legit.fyi.

Please note jq has substantially more potential than I can showcase in this small article.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.