1

Inspired by this question i am trying to delete specific folders from my bucket using wildcard in a gsutil command such as :

gsutil rm -r gs://bucket-name/path/to/**/content 

or

gsutil rm -r gs://bucket-name/path/to/*/content 

This is throwing the error :

zsh: no matches found: gs://bucket-name/path/to/**/content
zsh: no matches found: gs://bucket-name/path/to/*/content

Where the * or ** is replacing IDs (thousands of records) and under each there are 2 directories : content, content2 and i only want to remove the content directory

Thanks in advance

1 Answer 1

2

As per this answer by @Mike Schwartz, You have to use single or double quotes while using wildcards.

zsh is attempting to expand the wildcard before gsutil sees it (and is complaining that you have no local files matching that wildcard). Please try this, to prevent zsh from doing so:

gsutil rm 'gs://bucket/**'

Not the answer you're looking for? Browse other questions tagged or ask your own question.