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"

 

猜你喜欢

转载自www.cnblogs.com/jkklearn/p/9119291.html