0
0
Dockerdevops~5 mins

Listing containers (docker ps, docker ps -a) - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the command docker ps do?
It lists all running Docker containers on your system, showing details like container ID, image, status, and ports.
Click to reveal answer
beginner
What extra information does docker ps -a show compared to docker ps?
docker ps -a lists all containers, including those that are stopped, exited, or paused, not just the running ones.
Click to reveal answer
beginner
How can you see the status of a container using Docker commands?
Use docker ps or docker ps -a. The status column shows if a container is running, exited, or paused.
Click to reveal answer
intermediate
Why might you want to use docker ps -a instead of just docker ps?
To see all containers including those that have stopped or exited, which helps in troubleshooting or cleaning up unused containers.
Click to reveal answer
beginner
What information is typically shown in the output of docker ps?
Container ID, image name, command run, creation time, status, ports, and container name.
Click to reveal answer
Which command lists only running Docker containers?
Adocker ps -a
Bdocker list
Cdocker ps
Ddocker containers
What does the -a option do in docker ps -a?
AShows all containers including stopped ones
BShows only active containers
CShows containers with active ports
DShows containers in alphabetical order
If you want to check why a container stopped, which command helps you see its status?
Adocker start
Bdocker ps -a
Cdocker run
Ddocker logs
Which column in docker ps output tells you the container's current state?
APORTS
BIMAGE
CCOMMAND
DSTATUS
What command would you use to see all containers including those that exited hours ago?
Adocker ps -a
Bdocker ps
Cdocker inspect
Ddocker rm
Explain the difference between docker ps and docker ps -a.
Think about when you want to see containers that are not running.
You got /3 concepts.
    Describe what information you get from the output of docker ps.
    Look at the columns shown when you run the command.
    You got /7 concepts.