How to check the total number of object stored in S3 bucket in AWS?


I am searching my s3 bucket and I would like to know how can I check total number of objects (files) I have uploaded inside particular S3 Bucket on amazon web server? I am looking for easy solution here.


Asked by:- neena
0
: 1874 At:- 5/19/2020 2:40:41 PM
aws count files in s3 bucket amazon web service






1 Answers
profileImage Answered by:- bhanu

Method 1:

  1. Go to your S3 Buckets, select the bucket
  2. In the next screen, check the folder, click "Actions" button, select total size
    amazon-s3-bucket-object-count-min.png
  3. You will see a pop-up, with Total Object count and total size.
    amazon-s3-bucket-object-count-min.png

Method 2:

Using S3 API

aws s3api list-objects --bucket BUCKETNAME --output json --query "[length(Contents[])]"

For a specific folder

aws s3api list-objects --bucket BUCKETNAME --prefix "folder/subfolder/" --output json --query "[length(Contents[])]"

Method 3:

Using AWS CLI

aws s3 ls s3://bucketName/path/ --recursive --summarize | grep "Total Objects:"

Total Objects: 4023
1
At:- 5/20/2020 7:55:05 AM
Excellent answer, I find Method 1 very easy to check so used it, and it works, thanks 0
By : neena - at :- 5/29/2020 11:05:39 AM






Login/Register to answer
Or
Register directly by posting answer/details

Full Name *

Email *




By posting your answer you agree on privacy policy & terms of use

Subscribe Now

Subscribe to our weekly Newsletter & Keep getting latest article/questions in your inbox weekly