Skip to content
Arif Amirani
Go back

Snippet - Delete all S3 buckets with a single command

Deleting S3 buckets can be a painful multistep process. Buckets need to be emptied out before they can be removed with several captchas in place to avoid accidental deletes. aws-cli can be used to do this quickly.

The command will delete ALL S3 buckets. Use carefully
aws s3 ls | awk '{print $3}' | xargs -n1 -I{} aws s3 rb s3://{} --force

Command output



Previous Post
A JSON Based Serverless Quasi-Static Model
Next Post
Nature vs Nurture & Mentoring