
官方教程地址http://stedolan.github.io/jq/tutorial/1、获取JSON数据我们以github上jq项目最新5条评论的JSON数据为例。获取数据如下:curl "https://api.github.com/repos/stedolan/jq/commits?per_page=5"2、高亮并按属性排序显示用 jq "."即可:curl "https://api.github.com/repos/stedolan/jq/commits?per_page=5" | jq "."结果:这里的评论内容比较多,我们现在想拿第一个评论。3、获取数组某一项curl "http...