Created
February 10, 2022 14:16
-
-
Save jesusjimsa/f3efb6a07ab6e714686a0233dc459d82 to your computer and use it in GitHub Desktop.
Shell script to remove docker containers
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/bash | |
read -p "Are you sure? " -n 1 -r | |
echo | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then | |
docker rm -vf $(docker ps -a -q) 2>/dev/null | |
echo "Removed" | |
else | |
echo "All right then" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment