Skip to content

Instantly share code, notes, and snippets.

@pierric
Created June 18, 2019 11:54
Show Gist options
  • Save pierric/e4d146f4d24c725d3a39a7094c4bfaf5 to your computer and use it in GitHub Desktop.
Save pierric/e4d146f4d24c725d3a39a7094c4bfaf5 to your computer and use it in GitHub Desktop.
Find all node of some name, and deduplicated the values.
# list all the color node in the json file (recursively)
python -m jsmin <json_file> | jq '.. | .color? | select (. != null) | keys | .[]'
# list all and remove duplicated items.
python -m jsmin <json_file> | jq '[.. | .color? | select (. != null) | keys | .[]] | unique | .[]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment