docker remove all not running containers code example Example: docker remove not running containers docker container rm $(docker container ls –aq)