Last active
May 27, 2021 15:05
-
-
Save bradkarels/e7e09db37af16c151dcf to your computer and use it in GitHub Desktop.
Sweet command to remove all exited container from a Docker host. Obvious, be careful, not for prod...etc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker ps -a | grep Exited | awk '{print $1}' | xargs -r docker rm | |
docker ps -a | grep Exited | awk '{print $1}' | xargs --no-run-if-empty docker rm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment