Download files and folders from Google Storage bucket to a local folder

Dilvane Zanardine picture Dilvane Zanardine · Jul 25, 2012 · Viewed 75.4k times · Source

What's the best way to download all files from Google Cloud Storage?

Answer

Sebastian Kreft picture Sebastian Kreft · Jul 25, 2012

Take a look of the gsutil tool. You can use the cp command with the -R (recursive) and -m (multithreading) option.

gsutil -m cp -R gs://<bucket_name> .

And if you want to try it with a public bucket try

gsutil -m cp -R gs://uspto-pair .

The speedup granted by multithreading can be quite significant:

$ time gsutil cp -R gs://uspto-pair/docs/2010-08-28 .
...

real    0m12.534s

vs

$ time gsutil -m cp -R gs://uspto-pair/docs/2010-08-28 .
...

real    0m3.345s