-
根据你的操作系统来安装,比如:
- 在 Ubuntu 等 Debian 系系统上:
sudo apt-get install jq
- 在 CentOS 等 Red Hat 系系统上:
sudo yum install jq
- 在 macOS 上:
brew install jq
- 在 Ubuntu 等 Debian 系系统上:
-
确保
jq
有执行权限:
如果jq
已安装,但权限问题不能运行,确保设置了正确的执行权限:chmod +x $(which jq)
-
确保
jq
已经安装:
在终端里运行:jq --version
-
使用样例
echo '${json_string}' | jq .
安装Jq工具包
最新推荐文章于 2025-04-20 16:37:32 发布