docker exec -it myapp sh -c 'cat /etc/os-release'

Category: Docker

docker exec -it myapp sh -c 'cat /etc/os-release'

Run a compound command inside a container

sh -c runs a shell command string inside the container, here printing OS release info. Useful when a binary lacks the flags you need. The -it flags attach stdin and a TTY.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.