How do I delete/count objects in a s3 bucket?

前端 未结 6 727
借酒劲吻你
借酒劲吻你 2021-02-01 10:15

So I know this is a common question but there just doesn\'t seem to be any good answers for it.

I have a bucket with gobs (I have no clue how many) number of files in th

6条回答
  •  走了就别回头了
    2021-02-01 10:49

    Old thread, but still relevant as I was looking for the answer until I just figured this out. I wanted a file count using a GUI-based tool (i.e. no code). I happen to already use a tool called 3Hub for drag & drop transfers to and from S3. I wanted to know how many files I had in a particular bucket (I don't think billing breaks it down by buckets).

    So, using 3Hub, 
    - list the contents of the bucket (looks basically like a finder or explorer window)
    - go to the bottom of the list, click 'show all'
    - select all (ctrl+a)
    - choose copy URLs from right-click menu
    - paste the list into a text file (I use TextWrangler for Mac) 
    - look at the line count  
    

    I had 20521 files in the bucket and did the file count in less than a minute.

    I'd like to know if anyone's found a better way since this would take some time on hundreds of thousands of files.

提交回复
热议问题