THE BEST NEWSLETTER ANYWHERE
Join 6,000 subscribers and get a daily digest of full stack tutorials delivered to your inbox directly.No spam ever. Unsubscribe any time.
This tutorial explains multiple ways to show a list of containers in the Docker
The docker ps
command is used for the list of containers with different options. It is an alias for the docker container ls
command
The following are different commands
docker container ls
docker ps
docker ps command has the following options
-a
or --all
: Displays all containers(default lists running containers)-f
or --filter
: filter based on conditions. Example display exited containers with status=‘exited’-n
or --last int
: last n number containers-s
or --size
: show total file sizesTo show a list of containers in a docker, please follow the below steps.
Containers can be in a state of running or stopped.
docker ps
Output:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1fdb4b122a13 localstack "top" 3 weeks ago Up 3 days localstack
-a
(all states) optiondocker ps -a
docker ps -l
docker ps -f "status=excited"
or
docker ps --filter "status=excited"
docker ps -q
docker ps -a -n3
docker ps -s
ps is a name used for process status in Unix OS, Docker ps is used to find the container status and it has different options for listing containers with running status, sizes, last created containers
🧮 Tags
Recent posts
Julia examples - Variable Type Nim example - Convert String to/from the Int How to get length of an array and sequence in Nim? Nim environment variables - read, set, delete, exists, and iterate examples? How to convert from single character to/from string in Nim?Related posts