How to copy files between Cloud Shell and the local machine in GCP

–1 vote

Hi Guys,

I have some files in the GCP instance. I want to copy the files from the remote system to the local system. How can I do that with the command line?

Nov 9, 2020 in GCP by akhtar
• 38,170 points
1,088 views

1 answer to this question.

0 votes

Hi@akhtar,

You can copy files from the remote system to the local system using the gcloud command. To denote a file in Cloud Shell, prefix the file name with the string "cloudshell". To denote a local file, prefix the file name with the string "localhost" as shown below.

$ gcloud cloud-shell scp cloudshell:~/REMOTE-DIR localhost:~/LOCAL-DIR
answered Nov 9, 2020 by MD
• 95,180 points

Related Questions In GCP

+2 votes
2 answers

How to download multiple files in Google Cloud Storage?

You can achieve this through the gsutil ...READ MORE

answered May 9, 2018 in GCP by kurt_cobain
• 9,390 points
15,380 views
0 votes
1 answer

How does the pricing model work in GCP cloud?

While working with Google Cloud Platform, the ...READ MORE

answered Oct 7, 2019 in GCP by Sirajul
• 59,050 points
938 views
0 votes
1 answer

What are the service accounts in GCP? How to create one?

The special accounts associated with a project are called the Service Accounts. The ...READ MORE

answered Oct 9, 2019 in GCP by Sirajul
• 59,050 points
148 views
0 votes
1 answer

How to create a cloud storage bucket in GCP?

Buckets are the basic containers that hold your ...READ MORE

answered Oct 23, 2019 in GCP by Sirajul
• 59,050 points
897 views
+2 votes
1 answer

How to create a project in GCP Cloud?

Hi@akhtar, To deploy your app on App Engine, ...READ MORE

answered Aug 22, 2020 in GCP by MD
• 95,180 points
111 views
+2 votes
1 answer

How to activate GCP Cloud Shell?

Hi@MD, You can follow the below steps to ...READ MORE

answered Aug 22, 2020 in GCP by akhtar
• 38,170 points
157 views
+2 votes
1 answer

How to create a project from GCP Cloud Shell?

Hi@akhtar, GCP shell has a command named gcloud. ...READ MORE

answered Aug 22, 2020 in GCP by MD
• 95,180 points
187 views
+2 votes
1 answer

How to list down all the projects in GCP Cloud?

Hi@akhtar, GCP Shell has a command named gcloud. ...READ MORE

answered Aug 22, 2020 in GCP by MD
• 95,180 points
162 views
+2 votes
1 answer

How to create a firewall rule in GCP Cloud?

Hi@akhtar, If you are using the default VPC ...READ MORE

answered Aug 22, 2020 in GCP by MD
• 95,180 points
174 views