参考:https://alingse.github.io/jq-manual-cn/manual/v1.5/#TypesandValues
处理方式:
cat *.json|jq "path(..)"
输出即全部keys,类似如下:
原文:
Note that the path expressions are not different from normal expressions. The expression path(..|select(type=="boolean"))
outputs all the paths to boolean values in .
, and only those paths.
examples:
- program: ‘path(.a[0].b)’ input: ‘null’ output: [’[“a”,0,”b”]’]
- program: ‘[path(..)]’ input: ‘{“a”:[{“b”:1}]}’ output: [’[[],[“a”],[“a”,0],[“a”,0,”b”]]’]
没有评论:
发表评论