Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
6 views
in Docker by (2.3k points)
recategorized by

So we know that docker gives us the ability to list all the different containers that currently running using the below commmand :

$ docker ps # To list running containers

Then we can use the below command to list all the containers regardless of the fact whether they are running or not. 

$ docker ps -a # To list running and stopped containers

Is there a way where we only list those containers that are stopped and not the ones that are running?

1 Answer

0 votes
by (6.9k points)

To find out only the containers that are stopped you can use the below command :

$ docker ps --filter "status=exited"

Or use this command :

$ docker ps -f "status=exited"

Hope that helped :)


If you want to improve your docker skills and get that job you always yearned for try out docker training course. 

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...