Remove all stopped Docker containers

A simple one-liner to remove all stopped Docker containers:

for container in $(sudo docker ps -a | grep "Exited" | awk {'print $1'}); do sudo docker rm $container;done

Any comments or questions? Get in touch here or Email me at [email protected]