Section: Read and query YAML with yq

Read a list

bash
bash
yq '.features[]' config.yaml
Explanation

Useful for iterating over YAML sequences in shell scripts.

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 Read and query YAML with yq
Read a nested field
Print a nested value from YAML.
OpenIn sheetbashsame section
Filter objects in a sequence
Select matching records from a YAML array.
OpenIn sheetbashsame section
Convert YAML to JSON
Transform YAML into JSON for downstream tools.
OpenIn sheetbashsame section
Set an image tag
Update a nested container image value in place.
OpenIn sheetbash2 tag match
Append to a YAML array
Add a value to a sequence in place.
OpenIn sheetbash2 tag match
Delete a key
Remove an unwanted field from YAML.
OpenIn sheetbash2 tag match