jq Cheat Sheet/Get nested property

Select a value from a nested path.

Section: Selectors and Paths

Get nested property

bash
bash
echo '{"user":{"profile":{"email":"a@example.com"}}}' | jq '.user.profile.email'
Explanation

Dot chaining walks nested objects.

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 Selectors and Paths
Get object property
Select a top-level property by key.
OpenIn sheetbashsame section
Optional selector
Avoid errors when a key may be missing.
OpenIn sheetbashsame section
Get array element by index
Return an item from an array by position.
OpenIn sheetbashsame section
Slice an array
Return a subrange of elements.
OpenIn sheetbashsame section
Iterate over array items
Emit each array element separately.
OpenIn sheetbashsame section
Iterate object values
Emit each value in an object.
OpenIn sheetbashsame section