Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove all ".DS_Store" files from Google Cloud Storage with gsutil

I've done a gsutil rsync before, which included a lot of ".DS_Store" files that I didn't want to sync. Now I would like to get rid of them, but I can't seem to find a way of doing that.

The command I though would work is:

gsutil rm gs://my-bucket/\*.DS_Store\*

However, I'm getting an error stating "CommandException: No URLs matched:" when using this.

like image 636
JohnGB Avatar asked Oct 12 '25 10:10

JohnGB


1 Answers

This should do it:

gsutil -m rm -r gs://my-bucket/**/.DS_Store

Or with zsh

gsutil -m rm -r 'gs://my-bucket/**/.DS_Store'
like image 110
Mike Schwartz Avatar answered Oct 15 '25 20:10

Mike Schwartz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!