How to get the file count in amazon bucket linux cli

0 votes
I had try

aws s3 ls --bucket | wc -l

aws s3 ls  --bucket --recursive --summarize

But it shows folder names . I want folder name with their file counts specifically like

Bucket/foler/============== 37
bucket/folder/============== 12

Any help would be appreaciated.

Thanks
Apr 25, 2020 in DevOps & Agile by Shahzeb
• 120 points
3,699 views

1 answer to this question.

0 votes

Hi@Shahzeb,

You can do this task using the below command.

  • If you want to list total no of buckets.

$ aws s3 ls | wc -l
  • If you want to list total no of files in a bucket.

$ aws s3 ls s3://bucketname | wc -l
answered Apr 27, 2020 by MD
• 95,460 points

Related Questions In DevOps & Agile

+5 votes
1 answer

How to program and get the Digital Ocean ID of the current Droplet from within the Droplet?

You can run curl http://169.254.169.254/metadata/v1/id within the ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by Atul
• 10,240 points
3,475 views
0 votes
1 answer
0 votes
1 answer
+3 votes
1 answer

Unable to find the TargetArguments path While configuring dot cover in VSTS

For your unable to find the TargetArguments ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by ajs3033
• 7,300 points
1,225 views
0 votes
1 answer

Want to get active connections in LDAP in command prompt

You can track the active connections which ...READ MORE

answered Apr 3, 2018 in DevOps & Agile by shubham
• 7,340 points

edited Apr 3, 2018 by shubham 913 views
+13 votes
2 answers
0 votes
1 answer

How to simplify or automate task group creation in TFS?

You can easily import or export task ...READ MORE

answered Apr 25, 2018 in DevOps & Agile by ajs3033
• 7,300 points
1,907 views
0 votes
1 answer

How to disable linux user authentication on ldap server

You can try the below steps: passwd -l ...READ MORE

answered Apr 27, 2018 in DevOps & Agile by shubham
• 7,340 points
1,892 views
0 votes
2 answers

How to configure Prometheus server in linux?

Hi there , Setup Prometheus Configuration All the prometheus ...READ MORE

answered Jul 9, 2020 in DevOps & Agile by Suhana
• 340 points
1,188 views
0 votes
1 answer

How to install grafana tool in Linux?

Hi@akhtar, To download Grafana in Linux system, you ...READ MORE

answered May 29, 2020 in DevOps & Agile by MD
• 95,460 points
1,112 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP