I have an AWS S3 bucket s3://mybucket/
. Running the following command to count all files:
aws s3 ls s3://mybucket/ --recursive | wc -l
outputs: 279847
Meanwhile, the AWS console web UI clearly indicates 355,524
objects:
Why does aws s3 ls s3://mybucket/ --recursive | wc -l
list fewer files than the number of objects mentioned in the AWS web UI in my S3 bucket?
Replying to comments:
Bucket versioning is enabled:
When you have versioning enabled, each file version counts as a separate object in the bucket. You can list all versions of objects with the aws s3api CLI command: