LinuxCommandLibrary

docker-container-ls

list containers on the system

TLDR

List running containers

$ docker container ls
copy
List all containers
$ docker container ls -a
copy
List with specific format
$ docker container ls --format "{{.Names}}: {{.Status}}"
copy
Filter by status
$ docker container ls -f status=[running|exited|paused]
copy
Show only IDs
$ docker container ls -q
copy

SYNOPSIS

docker container ls [options]

DESCRIPTION

docker container ls lists containers on the Docker host, providing information about container IDs, images, commands, creation time, status, ports, and names. By default, only running containers are displayed, but the -a flag reveals all containers regardless of state.
This command is equivalent to the legacy docker ps command and serves as the primary interface for viewing container inventory. Filtering and formatting options make it suitable for scripting and automation workflows.

PARAMETERS

-a, --all

Show all containers (default shows running).
-q, --quiet
Only display container IDs.
-f, --filter filter
Filter output based on conditions.
--format string
Format output using Go template.
-n, --last n
Show n last created containers.
-s, --size
Display total file sizes.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community