Two ways to list AWS S3 buckets using CLI

  1. List all S3 buckets associated with the configured AWS credentials:
    aws s3 ls
  2. This is the core command that lists all S3 buckets associated with your AWS account.
    By default, it returns a JSON output containing detailed information about each bucket, including creation date, owner, and name.
    --query "Buckets[].Name" - this is a query that filters the output of the list-buckets command.
    It specifies that you are interested in only the "Name" attribute of each bucket object:
    aws s3api list-buckets --query "Buckets[].Name"