Skip to content

Instantly share code, notes, and snippets.

@jesusjimsa
Created February 10, 2022 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesusjimsa/f3efb6a07ab6e714686a0233dc459d82 to your computer and use it in GitHub Desktop.
Save jesusjimsa/f3efb6a07ab6e714686a0233dc459d82 to your computer and use it in GitHub Desktop.
Shell script to remove docker containers
#!/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