Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in DevOps and Agile by (29.3k points)

There's a command to list images, docker images, but there doesn't seem to be a corresponding docker container.

Other than becoming root and looking into /var/lib/docker there doesn't seem a way to do that. Am I missing something? Is that something one isn't supposed to do?

1 Answer

0 votes
by (50.2k points)

Here is some info that helps you to list the containers in docker

docker ps //To show only running containers

docker ps -a //To show all containers

docker ps -l //To show the latest created container

docker ps -n=-1  //To show n last created containers

docker ps -s  //To display total file sizes

In the new version of Docker, commands are updated, and some management commands are added:

docker container ls //To list all the running containers.

docker container ls -a //To clean them all,

docker rm $(docker ps -aq) //To list all the containers created irrespective of its state.

Browse Categories

...