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
557 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,060 points

Related Questions In DevOps & Agile

+5 votes
2 answers

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 26, 2018 in DevOps & Agile by Atul
• 10,240 points
951 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,280 points
240 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,320 points

edited Apr 3, 2018 by shubham 150 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,280 points
608 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,320 points
618 views
0 votes
2 answers

How to configure Prometheus server in linux?

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

answered Jul 8, 2020 in DevOps & Agile by Suhana
• 320 points
178 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 28, 2020 in DevOps & Agile by MD
• 95,060 points
140 views