I'm trying using gsutil to remove the contents of a Cloud Storage bucket (but not the bucket itself). According to the documentation, the command should be:
gsutil rm gs://bucket/**
However, whenever I run that (with my bucket name substituted of course), I get the following response:
zsh: no matches found: gs://my-bucket/**
I've checked permissions, and I have owner permissions. Additionally, if I specify a file, which is in the bucket, directly, it is successfully deleted.
Other information which may matter:
How do I go about deleting the contents of a bucket?
gsutil cp gs://my-gsutil-bucket-12005/test-renamed.txt . Copy a file from a bucket to your local computer with Python: Note that unlike with gsutil , with Python, you must specify a valid path for the local file name to store the remote object. If you specify dot as with gsutil , an error would occur.
gsutil performs all operations using transport-layer encryption (HTTPS), to protect against data leakage over shared network links.
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/**'
Note that you need to use single (not double) quotes to prevent zsh wildcard handling.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With