jq
is a command-line tool for parsing a JSON data (like grep
or sed
for a text data).
You can use the jq
command on Windows using a Git Bash, but firstly it has to be installed as it is not among the default tools.
This note shows how to install the jq
for the Git Bash on Windows.
Cool Tip: How to clear a commands history in Git Bash! Read More →
Git Bash: Install jq
Start the Git Bash and create a /usr/local/bin
directory, where the jq
will be installed:
User@Computer MINGW64 ~ $ mkdir -p "${EXEPATH}/usr/local/bin"
Download the jq
executable for Windows and copy it to the Git Bash’s /usr/local/bin
directory using the curl
command below:
User@Computer MINGW64 ~ $ curl -L -o /usr/local/bin/jq.exe \ https://github.com/stedolan/jq/releases/latest/download/jq-win64.exe
With the URL above you will always get the latest official release of the jq
for Windows.
If you don’t have permissions to run these command, start the Git Bash as administrator:
- Press ⊞ Win keybutton to open the start menu
- Type in
gitbash
to search for the command prompt - Press Ctrl + Shift + Enter to run the Git Bash as administrator
Check the jq
version from the Git Bash to ensure that it has successfully been installed:
User@Computer MINGW64 ~ $ jq --version - sample output - jq-1.6
Cool Tip: How to change a default startup directory in Git Bash! Read More →
Thanks for this, you just saved the day!!!
Thank you, this helped