How to get a list all .zip files in a bucket?

Hi,

I need to get a list of all .zip files located under certain folders (for instance 'Example'). Currently I'm using 

  gsutil ls -r gs://my_bucket/** | grep Example | grep '\.zip$'
but it takes a long time - about 7 minutes with 2M objects in the bucket.

Is there a more elegant and fast way to get the list?

Thanks, Vitaly

Solved Solved
0 1 1,403
1 ACCEPTED SOLUTION

Hi @vitaly_il,

Welcome to the Google Cloud Community!

You can try the following options:

  1. To list objects in a different way, you can use the console to list objects. Read List Objects Documentation.
  2. If you want to optimize your cloud storage performance, you should take a look at this blog.
  3. Try using "gcloud storage" instead of "gsutil". Read more about the gcloud storage CLI blog.
  4. You can also get in touch with Google Cloud Support if the above options don't work.

Let me know if it helped, thanks!

View solution in original post

1 REPLY 1

Hi @vitaly_il,

Welcome to the Google Cloud Community!

You can try the following options:

  1. To list objects in a different way, you can use the console to list objects. Read List Objects Documentation.
  2. If you want to optimize your cloud storage performance, you should take a look at this blog.
  3. Try using "gcloud storage" instead of "gsutil". Read more about the gcloud storage CLI blog.
  4. You can also get in touch with Google Cloud Support if the above options don't work.

Let me know if it helped, thanks!

Top Labels in this Space