linux 上解析JSON

Linux 上解析 json的有效工具  jq

https://stedolan.github.io/jq/manual/

[root@jinkk ~]# cat test.json 
{
    "name": "zhangsan",
    "skill":{
      "a":"good",
      "b":"nice"
    }
}

[root@jinkk ~]# cat test.json | jq '.name'
"zhangsan"

[root@jinkk ~]# cat test.json | jq '.skill.b'
"nice"

 

 

posted on 2018-05-31 22:10  思此狂  阅读(1040)  评论(0)    收藏  举报

导航