AWS CLI S3 Cheat Sheet/Delete an object

Remove a single object from S3.

Section: High-Level S3 Commands

Delete an object

bash
bash
aws s3 rm s3://my-bucket/tmp/data.csv
Explanation

Deletes the specified object key.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing High-Level S3 Commands
Delete a prefix recursively
Remove all objects under a prefix.
OpenIn sheetbashsame section
List buckets
List S3 buckets in the account.
OpenIn sheetbashsame section
List objects in a bucket
List top-level objects and prefixes in a bucket.
OpenIn sheetbashsame section
Upload a file to S3
Copy a local file into a bucket.
OpenIn sheetbashsame section
Download a file from S3
Copy an object from S3 to local disk.
OpenIn sheetbashsame section
Upload a directory recursively
Copy a local directory tree to S3.
OpenIn sheetbashsame section