Created
February 18, 2020 15:36
-
-
Save pablo384/a5bfcc61a562f0f9e35b24b193e5043b to your computer and use it in GitHub Desktop.
Delete all docker images ans Containers except one
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
#/bin/sh | |
#images | |
docker image rm -f $(docker images -a | grep -v "qtcustom" | awk 'NR>1 {print $3}') | |
#container | |
docker rm $(docker ps -a | grep -v "my_docker" | awk 'NR>1 {print $1}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment