获取 Google 云存储桶中文件夹内所有图像的 gsutil URI 列表的方法是什么?

huangapple go评论49阅读模式
英文:

How do I get a list of the gsutil URIs of all the images in a folder in google cloud storage bucket?

问题

我有一个存放多个文件夹的桶。这些文件夹中还包含存储在其中的图像。我想要创建一个包含所有这些图像的 gsutil URI 的 CSV 文件。如何能够实现这一点?

我找不到一种一次获取所有图像的 gsutil URI 的方法。

英文:

i have a bucket in which i have multiple folders. these folders further have images stored in them. i want to make a csv with the gsutil URIs of all these images. How can I do that?

I could not find a way to get the gsutil URIs of all images at once.

答案1

得分: 2

你需要添加 -R 参数,它将遍历所有文件夹:
gsutil ls -R gs://bucket-name
然后你可以使用 grep -v :$ 来排除文件夹。

英文:

You need to add -R parameter and it will go thru all folders:
gsutil ls -R gs://bucket-name
and then you can use grep -v :$ to discard folders

huangapple
  • 本文由 发表于 2023年2月8日 21:39:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/75386631.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定