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/**'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.