John
John

Reputation: 161

copy data from bucket to the home directory of `cloud shell terminal

I am working with goole cloud (GCP) and have some files on the bucket. I am trying to copy data from the bucket to the home directory of cloud shell terminal. I can not find a command for that. do you know the command?

I tried the following command which is not working:

gsutil cp gs://my-bucket client-name@cloudshell:~

Upvotes: 0

Views: 1056

Answers (2)

guillaume blaquiere
guillaume blaquiere

Reputation: 76063

Use simply the ~

# For one file
gsutil cp gs://my-bucket/my-file ~/

# For a directory
gsutil cp -r gs://my-bucket/* ~/

Upvotes: 0

Chris32
Chris32

Reputation: 4961

While you are at the HOME dir in your Cloud Shell run this:

gsutil cp -r gs://my-bucket/* ./

Upvotes: 1

Related Questions