Bird
0
0

What will be the result of running the command aws s3 ls s3://example-bucket/ if the bucket contains two folders named images/ and documents/?

medium📝 Predict Output Q4 of 15
AWS - CLI
What will be the result of running the command aws s3 ls s3://example-bucket/ if the bucket contains two folders named images/ and documents/?
AIt lists all files inside both folders recursively.
BIt returns an error because folders are not supported in S3.
CIt lists the two folders with a trailing slash indicating directories.
DIt shows only the bucket creation date and no contents.
Step-by-Step Solution
Solution:
  1. Step 1: Understand S3 folder structure

    S3 uses prefixes to simulate folders; folders appear with trailing slashes.
  2. Step 2: Analyze the command output

    aws s3 ls s3://example-bucket/ lists top-level objects and prefixes (folders).
  3. Step 3: Evaluate options

    It lists the two folders with a trailing slash indicating directories. correctly states that folders are listed with trailing slashes.
    It returns an error because folders are not supported in S3. is incorrect; folders are supported as prefixes.
    It lists all files inside both folders recursively. is incorrect; the command does not list contents recursively by default.
    It shows only the bucket creation date and no contents. is incorrect; the command lists contents, not bucket metadata.
  4. Final Answer:

    It lists the two folders with a trailing slash indicating directories. -> Option C
  5. Quick Check:

    S3 folders appear with trailing slashes in 'aws s3 ls' [OK]
Quick Trick: Folders show with trailing slashes in 'aws s3 ls' output [OK]
Common Mistakes:
MISTAKES
  • Expecting recursive listing without --recursive
  • Thinking S3 does not support folders
  • Confusing bucket metadata with contents
  • Assuming folders are actual directories

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes