Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove all files under a folder Google Cloud Storage

I have hundred files under a folder in Google Cloud Storage. But, the UI doesn't give me a way to select all files at once.

How can I select all files and delete them at once ?

like image 507
thinkanotherone Avatar asked May 28 '14 00:05

thinkanotherone


People also ask

How do I delete a folder in Google Cloud Storage?

Navigate to the objects, which may be located in a folder. Click the checkbox for each object you want to delete. You can also click the checkbox for folders, which will delete all objects contained in that folder. Click the Delete button.


1 Answers

The easiest way would be to use the command-line utility, gsutil. This command will delete them all:

gsutil -m rm gs://BUCKET_NAME/**

If you want to delete the bucket as well, you could do this instead:

gsutil -m rm -R gs://BUCKET_NAME
like image 96
Brandon Yarbrough Avatar answered Oct 27 '22 13:10

Brandon Yarbrough