gcloud compute scp deploy.sh web-server:/home/alex/ --zone us-central1-a

Category: Google Cloud & Workspace

gcloud compute scp deploy.sh web-server:/home/alex/ --zone us-central1-a

Copy a file to a VM instance

Securely copies a local file to the instance using the same key handling as gcloud compute ssh, so no separate scp setup is needed. The destination takes the form USER@INSTANCE:REMOTE_PATH, where /home/alex/ is the home of the connecting user. Copy whole directories by adding --recurse.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.