It's wrong this command since it will remove all containers (running and stopped containers)!
docker ps -a -q will show you all containers into short syntax and docker rm will remove them!
The right syntax should be docker rm $(docker ps --filter status=exited -q) to remove all stopped containers
Great Cheatsheet !!
I would add:
docker rm $(docker ps -a -q)
to delete all stopped containers
It's wrong this command since it will remove all containers (running and stopped containers)!
docker ps -a -q will show you all containers into short syntax and docker rm will remove them!
The right syntax should be docker rm $(docker ps --filter status=exited -q) to remove all stopped containers
No you have to use -f (force) to remove also running containers
Thanks for the contribution! Just added it :)