Skip to content

Instantly share code, notes, and snippets.

@montao
Created November 3, 2021 06:46
Show Gist options
  • Save montao/c789e21149780fb15b585050e09365a3 to your computer and use it in GitHub Desktop.
Save montao/c789e21149780fb15b585050e09365a3 to your computer and use it in GitHub Desktop.
Delete bucket(s) from s3 like rm -rf
# replace "fuzzbazz" with a word that matches a sequence of characters in the name of the bucket(s) you wish to delete
for bucket in $(aws s3 ls | awk '{print $3}' |grep "fuzzbazz"); 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