Using jq on MacOS without homebrew

Started using so much of jq on Linux, I wanted to use it on my Mac as well. Most of the internet posts point to the use of homebrew to install jq. I was looking for an easier option and got to the following.

Download jq binary for Mac from https://jqlang.github.io/jq/download/

$ sudo cp ~/Downloads/jq-macos-arm64 /usr/local/bin/jq
$ sudo chmod +x /usr/local/bin/jq

If you try to run jq you will get the following warning.

“jq” can’t be opened because Apple cannot check it for malicious software.

If so, do the following which should allow you to run jq without any issues.

$ sudo xattr -dr com.apple.quarantine /usr/local/bin/jq

You can check if jq works with a simple command like the following.

$ echo '{"foo": 0}' | jq .
{
"foo": 0
}
Disclaimer: The above is for information purposes only.  As always use any sudo commands and security overriding commands with caution.
Like it? Share ...Share on twitter
Twitter
Share on linkedin
Linkedin
Subscribe
Notify of
guest
2 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Накрутка авито
Накрутка авито
8 days ago

It’s great to see how jq is becoming more accessible across different operating systems. Using homebrew seems to be the go-to method for installation on Mac. The warning about malicious software can be a bit alarming, but following the steps provided should resolve it. Checking if jq works with a simple command is a smart way to ensure everything is set up correctly. Is there any alternative method to install jq that doesn’t involve homebrew?

2
0
Would love your thoughts, please comment.x
()
x
Verified by MonsterInsights