Last active
June 20, 2019 21:41
-
-
Save Khalian/348d0e59fa076fce1144e849ac9c3cca to your computer and use it in GitHub Desktop.
Remove s3 buckets bulk
This file contains hidden or 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 | |
if [ $# -ne 1 ] | |
then | |
echo "Usage: ./s3bucketRM.sh bucketNameSubstring" | |
exit 1 | |
fi | |
for bucket in $(aws s3 ls | awk '{print $3}'| grep $1); do aws s3 rb "s3://${bucket}" --force ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment