1

I can see on the docs how to rename files (blobs) in a bucket. However, I am looking for way to rename only those files/blobs that start with a specific prefix in a bucket (ie. renaming using wildcard like gs://my-bucket/loc/my-file*) I don't see a blob "name" property in the docs to try to match to after getting list of blobs in a bucket.
Is there a way to do that using Python language?

Thanks

FZF
  • 855
  • 4
  • 12
  • 29
  • Possible duplicate of [Mass rename objects on Google Cloud Storage](https://stackoverflow.com/questions/27166441/mass-rename-objects-on-google-cloud-storage) – PrecariousJimi May 27 '17 at 11:43

1 Answers1

0

Using gsutil, it is possible to use wildcard naming and rename all files starting with a prefix to another name.

FZF
  • 855
  • 4
  • 12
  • 29
  • 1
    Can you give me an example? For example, what if i want to rename mulitple files gs://dir_1/abc_test_* to gs://dir_2/test_* – Tuan Vu Dec 22 '17 at 17:31