docker exec -it my-container bash

Meaning: Executes a command inside a running container. Usage: To run commands in an interactive terminal within a container. Example: docker exec -it my-container bash opens a bash shell in the my-container container.

Explanation of -it Flag:

Example: docker exec -it my-container sh opens a shell in the my-container container for interactive use.

-i (Interactive)

-t (Pseudo-TTY)

-it (Interactive Terminal)