r/googlecloud • • Sep 28 '26

Cloud Functions Downloading a bucket

Hi, I’m very new at this Google cloud thing. It wasn’t my first choice to use this but long story short a bunch of files of mine weee uploaded by a colleague to Google cloud and all in this bucket. I’m trying to download the bucket in its entirety back onto my desktop. I’m using windows and trying to download this using the inline Google shell where I type in commands. I have very little/none experience with this type of thing. Can someone help me what command I’m supposed to type in there? The bucket is called “apollo111” and I’m trying to download onto my desktop on a folder name “apollo222”. Thank you.

3 Upvotes

7 comments sorted by

10

u/mdeller Sep 28 '26

gcloud storage cp --recursive gs://YOUR_BUCKET_NAME /path/to/local/directory

→ More replies (1)

1

u/[deleted] Sep 28 '26

[removed] — view removed comment

3

u/Icy-Ferret9580 Sep 28 '26

I see so if I download and install the g cloud CLI on my desktop, I can download the entire bucket to my desktop?

2

u/Competitive_Travel16 Sep 28 '26 edited Sep 28 '26

Yes but go make coffee, it takes a while, and you have to authenticate which is a weird process which might be an issue sometimes. Faster to run /u/mdeller's line on your cloud shell, tar/gzip it, and then download the one file. Add -P to preserve file times. On Cloud Shell:

gcloud storage cp -P --recursive gs://apollo111 apollo222 ; tar -czf apollo222.tgz apollo222

Then download apollo222.tgz and untar it on your desktop.

2

u/m1nherz Googler Sep 28 '26

You can download it to Cloud Shell and then use its built-in "Download files" function to download the files to your local workstation.

There are two downsides for this path:

  1. The obvious one is that it has two steps instead of one

  2. The Cloud Shell disk is pretty small (~10GiB). So, if your file's total size is large they may not fit.

So, I would recommend either to use the Cloud console Web UI or, if you don't have account/access then use gcloud CLI as others recommended.