-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
Description
-
Environment: Ubuntu 24.04, AWS CLI
-
Issue: While listing S3 bucket contents, I found an inconsistency when navigating subdirectories.
-
Steps to reproduce:
- Run
aws s3 ls root1
→ files and folders underroot1
are listed correctly. - Run
aws s3 ls root1/root2
→ no files are shown. - Run
aws s3 ls root1/root2/root2
- Run
aws s3 ls root1/root2
again → files are listed correctly.
- Run
-
Expected behavior:
aws s3 ls root1/root2
should list the contents insideroot2
without requiring a trailing slash. -
Actual behavior:
The contents are only shown if a trailing slash/
is added. -
Notes:
Not sure if this is a bug or intended behavior, but it feels unintuitive and inconvenient when navigating S3 buckets.
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
aws s3 ls root1/root2 should directly show the contents of root2 without requiring a trailing slash.
Current Behavior
aws s3 ls root1/root2
shows no files unless a trailing slash /
is added.
Reproduction Steps
- Run
aws s3 ls root1
→ contents appear. - Run
aws s3 ls root1/root2
→ no contents. - Run
aws s3 ls root1/root2/root2/
→ no contents - Run
aws s3 ls root1/root2
→ contents appear
Possible Solution
Make aws s3 ls <path>
list contents regardless of trailing slash.
Additional Information/Context
No response
CLI version used
downloaded with command curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" unzip awscliv2.zip
Environment details (OS name and version, etc.)
linux Ubuntu 24.04
Window latest updated version