Skip to content

Instantly share code, notes, and snippets.

@akr4
Created April 20, 2019 04:38
Show Gist options
  • Save akr4/3782cba821d7711c724062d3da0df599 to your computer and use it in GitHub Desktop.
Save akr4/3782cba821d7711c724062d3da0df599 to your computer and use it in GitHub Desktop.
list all paths from a json
# https://github.com/stedolan/jq/issues/243#issuecomment-48470943
jqpath () {
jq '[path(..)|map(if type=="number" then "[]" else tostring end)|join(".")|split(".[]")|join("[]")]|unique|map("."+.)|.[]'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment