This command (docker ps
) list the containers.
$ docker ps [OPTIONS]
—all
, -a
→ Show all containers (running)--filter
, -f
→ Filter output based on conditions provided--format
→ Print containers using a Go template--last
, -n
→ Show n last created containers (all states)--latest
, -l
→ Show the latest created container (all states)--no-trunc
→ Not truncated output--quiet
, -q
→ Only display container IDs--size
, -s
→ Display the total file sizes$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5521be4273f6 nginx:1.19.1 "/docker-entrypoint.…" 6 seconds ago Up 5 seconds 80/tcp competent_sutherland
--all
)$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5521be4273f6 nginx:1.19.1 "/docker-entrypoint.…" 9 seconds ago Up 8 seconds 80/tcp competent_sutherland
318bb50490ab ubuntu:20.04 "/bin/bash" 5 seconds ago Exited (0) 5 seconds ago sleepy_brahmagupta
--size
)$ docker ps -s
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES SIZE
5521be4273f6 nginx:1.19.1 "/docker-entrypoint.…" 4 minutes ago Up 4 minutes 80/tcp competent_sutherland 1.12kB (virtual 132MB)
$ docker ps --format
{
"Command": "\\"/docker-entrypoint.…\\"",
"CreatedAt": "12:11:11 -0400 EDT",
"ID": "77a6bad66f660",
"Image": "nginx:1.19.1",
"Labels": "maintainer=NGINX Docker Maintainers <docker-maint@nginx.com>",
"LocalVolumes": "0",
"Mounts": "",
"Names": "heuristic_black",
"Networks": "bridge",
"Ports": "80/tcp",
"RunningFor": "10 minutes ago",
"Size": "0B",
"Status": "Up 10 minutes"
}