Skip to main content

ls

The aws s3 ls command is used to list S3 buckets and the contents of Amazon S3 buckets. It's a useful tool for exploring your stored data, checking the existence of files, and managing your cloud storage. This command supports various options to customize the listing operation.

Syntax

List Buckets

aws s3 ls

List Bucket Contents

aws s3 ls s3://bucketname/optional/path

Options

  • path: s3://bucketname/optional/path: The path in the S3 bucket from which to list the contents.

  • --recursive: Lists all subfolders and files.
  • --human-readable: Displays file sizes in a human-readable format.
  • --summarize: Provides a summary of the listing, including the total number of objects and total size.

See also the original AWS documentation.