Docker Course
Docker
/
Beginner

docker ps

Definition

The CLI command that outputs a list of currently running containers, showing their IDs, image names, uptime, and mapped ports.

Explain Like I'm New

The Task Manager for Docker. It shows you exactly what containers are currently turned on and running on your computer.

Real World Example

You start a database but forget which port you assigned it to. You type `docker ps`, look at the port column, and see it is running on port 5432.

Common Use Cases

  • •Monitoring state
  • •Finding Container IDs

Crucial Command Flags

Flag / OptionDescription
-a / --allShow all containers (default shows just running).
-q / --quietOnly display container IDs (useful for piping to other commands).
-s / --sizeDisplay the total file sizes.

Interview Questions

basic

  • Will `docker ps` show you containers that are currently Stopped/Exited?

intermediate

  • Why is it called `ps`?

Flash Cards

Question

Show stopped containers?

Click to reveal answer
Answer

No. By default, it only shows live, running containers. You must add the `-a` (all) flag (e.g., `docker ps -a`) to see stopped containers.

Question

Why called ps?

Click to reveal answer
Answer

It is inherited from Unix/Linux terminology, where `ps` stands for 'Process Status'.