Skip to content

Instantly share code, notes, and snippets.

@frank-leap
Forked from cjdd3b/s3count.md
Created February 9, 2018 16:11
Show Gist options
  • Save frank-leap/60f3a98f76a129540e40149f1a669545 to your computer and use it in GitHub Desktop.
Save frank-leap/60f3a98f76a129540e40149f1a669545 to your computer and use it in GitHub Desktop.
How to count files in an S3 bucket

Counting files in S3 buckets and folders is harder than it should be. But here's a way to get it done using s3cmd:

  1. Install S3cmd
  • On Mac, brew install s3cmd
  • On Windows, go here
  1. From the command line, run s3cmd --configure

  2. Add your credentials when prompted.

  3. Once it's all set up and working, run: s3cmd ls --recursive s3://BUCKET_NAME/FOLDER_NAME | wc -l

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment