Which command shows all containers, including those that have exited?

Prepare for the Kubernetes Cloud Native Associate (KCNA) Certification test with engaging questions and detailed explanations. Perfect your knowledge and boost your confidence to pass the exam successfully!

Multiple Choice

Which command shows all containers, including those that have exited?

Explanation:
To see all containers, including those that have exited, you use the -a flag with the list command. Docker ps shows only currently running containers by default, so adding -a expands the view to include every container in any state (running, paused, exited, etc.). This is why the correct command is docker ps -a: it reveals the full set of containers and their final statuses, such as Exited, along with exit codes. If you’re using the newer CLI namespace, docker container ls -a is equivalent, but the essential concept is using -a to show all containers.

To see all containers, including those that have exited, you use the -a flag with the list command. Docker ps shows only currently running containers by default, so adding -a expands the view to include every container in any state (running, paused, exited, etc.). This is why the correct command is docker ps -a: it reveals the full set of containers and their final statuses, such as Exited, along with exit codes. If you’re using the newer CLI namespace, docker container ls -a is equivalent, but the essential concept is using -a to show all containers.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy