How to Recursively Delete all Files in an AWS S3 Bucket

If you need to recursively delete all files in an AWS S3 bucket, then you can do the following:

aws s3 rm --recursive s3://your-bucket-name/foo/bar/
Code language: Bash (bash)

If you only want to delete an specific object from AWS S3:

aws s3 rm s3://your-bucket-name/foo/bar/item.txt
Code language: Bash (bash)

Tags:
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments