Skip to content

Instantly share code, notes, and snippets.

@Khalian
Last active June 20, 2019 21:41
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 Khalian/348d0e59fa076fce1144e849ac9c3cca to your computer and use it in GitHub Desktop.
Save Khalian/348d0e59fa076fce1144e849ac9c3cca to your computer and use it in GitHub Desktop.
Remove s3 buckets bulk
#!/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