docker exec -i <container_name> <command>

Meaning: Runs the command in interactive mode. Usage: Keeps STDIN open for the command. Example: docker exec -i my-container cat /etc/hosts shows the contents of /etc/hosts in my-container.