Print a nested value from YAML.
Section: Read and query YAML with yq
Read a nested field
bash
bash
yq '.spec.template.spec.containers[0].image' deployment.yamlExplanation
Excellent for scripts, CI jobs, and quick inspections.
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