jq Filters and Transformations/Find all keys recursively

Emit every key in nested objects.

Section: Encoding and Recursion

Find all keys recursively

bash
bash
echo '{"a":1,"b":{"c":2}}' | jq '.. | objects | keys[]'
Explanation

Useful for schema discovery and audits.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Encoding and Recursion
Find all numbers recursively
Emit every number in a document.
OpenIn sheetbashsame section
JSON-encode raw text
Turn raw text into a valid JSON string.
OpenIn sheetbashsame section
HTML-escape a string
Escape special HTML characters.
OpenIn sheetbashsame section
Shell-escape a string
Produce a shell-safe quoted string.
OpenIn sheetbashsame section
Logical AND
Filter items that satisfy two conditions.
OpenIn sheetbash1 tag match
Test regex match
Return true if a string matches a pattern.
OpenIn sheetbash1 tag match