yq '.services.db.image' docker-compose.yml

Category: Web App Development

yq '.services.db.image' docker-compose.yml

Read a value from a YAML file with yq

Prints the image key under services.db, using the same dot-path syntax as jq but for YAML. yq is the standard YAML processor for scripts and CI. Use -i with an assignment to edit files in place.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.