docker remove all closed containers code example Example: docker remove all closed containers docker rm $(docker container ls -aq)