HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/394/help/man/man1/gcloud_beta_cloud-shell_scp.1
.TH "GCLOUD_BETA_CLOUD\-SHELL_SCP" 1



.SH "NAME"
.HP
gcloud beta cloud\-shell scp \- copies files between Cloud Shell and the local machine



.SH "SYNOPSIS"
.HP
\f5gcloud beta cloud\-shell scp\fR (\fIcloudshell\fR|\fIlocalhost\fR):\fISRC\fR [(\fIcloudshell\fR|\fIlocalhost\fR):\fISRC\fR\ ...] (\fIcloudshell\fR|\fIlocalhost\fR):\fIDEST\fR [\fB\-\-dry\-run\fR] [\fB\-\-force\-key\-file\-overwrite\fR] [\fB\-\-recurse\fR] [\fB\-\-scp\-flag\fR=\fISCP_FLAG\fR] [\fB\-\-ssh\-key\-file\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

\fB(BETA)\fR \fBgcloud beta cloud\-shell scp\fR copies files between your Cloud
Shell instance and your local machine using the scp command.



.SH "EXAMPLES"

To denote a file in Cloud Shell, prefix the file name with the string
"cloudshell:" (e.g. \fIcloudshell:\fR~/\fIFILE\fR). To denote a local file,
prefix the file name with the string "localhost:" (e.g.
\fIlocalhost:\fR~/\fIFILE\fR). For example, to copy a remote directory to your
local machine, run:

.RS 2m
$ gcloud beta cloud\-shell scp cloudshell:~/REMOTE\-DIR \e
  localhost:~/LOCAL\-DIR
.RE

In the above example, \fB\fI~/REMOTE\-DIR\fR\fR from your Cloud Shell instance
is copied into the ~/\fILOCAL\-DIR\fR directory.

Conversely, files from your local computer can be copied into Cloud Shell:

.RS 2m
$ gcloud beta cloud\-shell scp localhost:~/LOCAL\-FILE\-1 \e
  localhost:~/LOCAL\-FILE\-2 cloudshell:~/REMOTE\-DIR
.RE

Under the covers, \fBscp(1)\fR or pscp (on Windows) is used to facilitate the
transfer.



.SH "POSITIONAL ARGUMENTS"

.RS 2m
.TP 2m
(\fIcloudshell\fR|\fIlocalhost\fR):\fISRC\fR [(\fIcloudshell\fR|\fIlocalhost\fR):\fISRC\fR ...]

Specifies the files to copy.

.TP 2m
(\fIcloudshell\fR|\fIlocalhost\fR):\fIDEST\fR

Specifies a destination for the source files.


.RE
.sp

.SH "FLAGS"

.RS 2m
.TP 2m
\fB\-\-dry\-run\fR

If provided, prints the command that would be run to standard out instead of
executing it.

.TP 2m
\fB\-\-force\-key\-file\-overwrite\fR

If enabled gcloud will regenerate and overwrite the files associated with a
broken SSH key without asking for confirmation in both interactive and
non\-interactive environment.

If disabled gcloud will not attempt to regenerate the files associated with a
broken SSH key and fail in both interactive and non\-interactive environment.

.TP 2m
\fB\-\-recurse\fR

Upload directories recursively.

.TP 2m
\fB\-\-scp\-flag\fR=\fISCP_FLAG\fR

Extra flag to be sent to scp. This flag may be repeated.

.TP 2m
\fB\-\-ssh\-key\-file\fR

The path to the SSH key file. By default, this is
\fB~/.ssh/google_compute_engine\fR.


.RE
.sp

.SH "GCLOUD WIDE FLAGS"

These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.

Run \fB$ gcloud help\fR for details.



.SH "NOTES"

This command is currently in beta and might change without notice. These
variants are also available:

.RS 2m
$ gcloud cloud\-shell scp
.RE

.RS 2m
$ gcloud alpha cloud\-shell scp
.RE