Stop / remove all Docker containers
$ docker stop $(docker ps -a -q)
$ docker rm $(docker ps -a -q)
- List containers with
docker ps.-a/--allinclude also the stopped ones and-q/--quietdisplay only the numeric IDs. - Use
docker stopanddocker rmwith the output of the first command (got from bash command substitution).
References: