本文共 550 字,大约阅读时间需要 1 分钟。
jq可以将json数据格式化,也可以按照一个规则将数据切片过滤。
点击下载
官网:https://stedolan.github.io/jq/
将下载后的安装包上传到linux上任意地方
然后执行以下命令解压编译安装
tar -zxvf jq-1.5.tar.gzcd jq-1.5./configure && make && make install
输入以下命令测试
echo '{"id":1,"name":"xhx"}' | jq .
更多jq使用教程查看:https://stedolan.github.io/jq/tutorial/
如果执行报错:curl: (1) Protocol “https” not supported or disabled in libcurl 查看
如果执行报错:configure: error: You need bison version 3.0 or greater, or use --disable-maintainer-mode
安装时就执行./configure --disable-maintainer-mode && make && make install
转载地址:http://cduzi.baihongyu.com/