delete exited docker containers code example
Example 1: docker remove all dead containers
$ docker rm $(docker ps -a -q)
Example 2: docker remove exited containers
(docker ps -a |findstr Exited) | foreach-object {docker rm $_.split(" ")[-1]}
$ docker rm $(docker ps -a -q)
(docker ps -a |findstr Exited) | foreach-object {docker rm $_.split(" ")[-1]}