How to kill all docker containers

Posted on January 8, 2020
Tags: docker, bash

Using docker often leaves me with a lot of dangling containers and I always forget the command to stop and delete them. Here it is:

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)