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 in DevOps & Agile by Shahzeb
• 120 points
28 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 by MD
• 24,500 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
600 views
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
155 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
• 6,910 points

edited Apr 3, 2018 by shubham 83 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
424 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
• 6,910 points
248 views
0 votes
1 answer

How to disable auto-restart task in TeamCity

There is a parameter which can be ...READ MORE

answered Apr 29, 2018 in DevOps & Agile by DareDev
• 6,850 points
143 views
0 votes
1 answer

How to configure Prometheus server in linux?

Hi@akhtar You can follow the below given steps ...READ MORE

answered May 27 in DevOps & Agile by MD
• 24,500 points
36 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 in DevOps & Agile by MD
• 24,500 points
24 views