Skip to main content

rm

The aws s3 rm command is used to delete objects from an Amazon S3 bucket. It's a crucial tool for managing and maintaining your S3 storage by allowing the removal of unnecessary files or objects. This command can be used to delete a single object or multiple objects in a batch.

Syntax

aws s3 rm s3://bucketname/path/to/object

Options

  • s3://bucketname/path/to/object: The path to the object you want to remove.

  • --recursive: Delete all objects in a specified directory.
  • --include/--exclude: Filter objects to delete using a pattern.

See also the original AWS documentation.