Forrest logo
back to the aws tool

aws-s3-ls:tldr:13dc8

aws-s3-ls: List all files in a bucket.
$ aws s3 ls --recursive ${bucket_name}
try on your machine

The command "aws s3 ls --recursive ${bucket_name}" is used to list all the objects (files and folders) within an Amazon S3 bucket, including those within subdirectories.

Here's a breakdown of the command and its components:

  • "aws s3 ls": This is the basic command to list objects in an Amazon S3 bucket. "aws" is the command-line interface (CLI) for Amazon Web Services (AWS), and "s3" is the service for Simple Storage Service (S3). "ls" is the command to list objects.

  • "--recursive": This option tells the command to list objects recursively, which means it will also display the contents of subdirectories within the bucket.

  • "${bucket_name}": This is a placeholder for the name of the S3 bucket you want to list the objects from. You need to replace "${bucket_name}" with the actual name of your bucket.

When you run this command with the appropriate bucket name, it will display a list of all the objects within the bucket, including their names, sizes, and last modification timestamps. If there are subdirectories within the bucket, it will also show the objects within those subdirectories.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the aws tool