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,260 points
9,447 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


Hope it helps!!

If you need to know more about Google Cloud, We recommend joining GCP Certification course today.

Thanks!

answered Nov 9, 2020 by MD
• 95,460 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
23,482 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,230 points
2,851 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,230 points
896 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 24, 2019 in GCP by Sirajul
• 59,230 points
2,621 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 23, 2020 in GCP by MD
• 95,460 points
702 views
+2 votes
1 answer

How to activate GCP Cloud Shell?

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

answered Aug 23, 2020 in GCP by akhtar
• 38,260 points
2,457 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 23, 2020 in GCP by MD
• 95,460 points
1,979 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 23, 2020 in GCP by MD
• 95,460 points
4,094 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 23, 2020 in GCP by MD
• 95,460 points
1,577 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP