JQ is available in almost all modern operating systems and can be installed fairly easily in a couple of commands. In my view tools like jq, git should be included as part of the OS distribution.
Installing JQ in Windows OS:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
## ---------- ## Windows OS ## ---------- ## Check if Chocolety is already installed choco --version #should return an output ## Install Chocolety if not already installed ## Open a command propmt as admin and execute below command @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" ## Install jq chocolatey install jq |
Installing JQ in MAC OS:
1 2 3 4 5 6 7 8 9 10 11 12 |
## ------ ## MAC OS ## ------ ## Check if Homebrew already installed brew --version #should return an output ## Install Homebrew if not already installed /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ## Install jq brew install jq |
Installing JQ in Ubuntu or Debian OS:
1 2 3 4 5 6 |
## ------------------ ## Ubuntu | Debian OS ## ------------------ ## Install jq sudo apt-get install jq |
Installing JQ in REDHAT or CentOS OS:
1 2 3 4 5 6 |
## ---------------- ## RHEL | CentOS OS ## ---------------- ## Install jq sudo yum -y install jq |
Installing JQ in Fedora OS:
1 2 3 4 5 6 |
## --------- ## Fedora OS ## --------- ## Install jq sudo dnf -y install jq |
Installing JQ in AWS EC2 instance with Amazon Linux OS:
1 2 3 4 5 6 |
## --------------- ## Amazon Linux OS ## --------------- ## Install jq sudo yum -y install jq |
Once you have installed JQ in your OS, validate the installation by running jq –version command.
1 2 3 4 5 6 |
## --------------------- ## Validate Installation ## --------------------- ## Should return an output jq --version |