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/current/help/man/man1/gcloud_storage_mv.1
.TH "GCLOUD_STORAGE_MV" 1



.SH "NAME"
.HP
gcloud storage mv \- moves or renames objects



.SH "SYNOPSIS"
.HP
\f5gcloud storage mv\fR [\fISOURCE\fR\ ...] \fIDESTINATION\fR [\fB\-\-additional\-headers\fR=\fIHEADER\fR=\fIVALUE\fR] [\fB\-\-all\-versions\fR,\ \fB\-A\fR] [\fB\-\-no\-clobber\fR,\ \fB\-n\fR] [\fB\-\-content\-md5\fR=\fIMD5_DIGEST\fR] [\fB\-\-continue\-on\-error\fR,\ \fB\-c\fR] [\fB\-\-daisy\-chain\fR,\ \fB\-D\fR] [\fB\-\-do\-not\-decompress\fR] [\fB\-\-include\-managed\-folders\fR] [\fB\-\-manifest\-path\fR=\fIMANIFEST_PATH\fR,\ \fB\-L\fR\ \fIMANIFEST_PATH\fR] [\fB\-\-preserve\-posix\fR,\ \fB\-P\fR] [\fB\-\-print\-created\-message\fR,\ \fB\-v\fR] [\fB\-\-read\-paths\-from\-stdin\fR,\ \fB\-I\fR] [\fB\-\-skip\-unsupported\fR,\ \fB\-U\fR] [\fB\-\-storage\-class\fR=\fISTORAGE_CLASS\fR,\ \fB\-s\fR\ \fISTORAGE_CLASS\fR] [\fB\-\-canned\-acl\fR=\fIPREDEFINED_ACL\fR,\ \fB\-\-predefined\-acl\fR=\fIPREDEFINED_ACL\fR,\ \fB\-a\fR\ \fIPREDEFINED_ACL\fR\ \fB\-\-[no\-]preserve\-acl\fR,\ \fB\-p\fR] [\fB\-\-gzip\-in\-flight\fR=[\fIFILE_EXTENSIONS\fR,...],\ \fB\-j\fR\ [\fIFILE_EXTENSIONS\fR,...]\ |\ \fB\-\-gzip\-in\-flight\-all\fR,\ \fB\-J\fR\ |\ \fB\-\-gzip\-local\fR=[\fIFILE_EXTENSIONS\fR,...],\ \fB\-z\fR\ [\fIFILE_EXTENSIONS\fR,...]\ |\ \fB\-\-gzip\-local\-all\fR,\ \fB\-Z\fR] [\fB\-\-ignore\-symlinks\fR\ |\ \fB\-\-preserve\-symlinks\fR] [\fB\-\-decryption\-keys\fR=[\fIDECRYPTION_KEY\fR,...]\ \fB\-\-encryption\-key\fR=\fIENCRYPTION_KEY\fR] [\fB\-\-cache\-control\fR=\fICACHE_CONTROL\fR\ \fB\-\-content\-disposition\fR=\fICONTENT_DISPOSITION\fR\ \fB\-\-content\-encoding\fR=\fICONTENT_ENCODING\fR\ \fB\-\-content\-language\fR=\fICONTENT_LANGUAGE\fR\ \fB\-\-content\-type\fR=\fICONTENT_TYPE\fR\ \fB\-\-custom\-time\fR=\fICUSTOM_TIME\fR\ \fB\-\-clear\-custom\-metadata\fR\ |\ \fB\-\-custom\-metadata\fR=[\fICUSTOM_METADATA_KEYS_AND_VALUES\fR,...]\ |\ \fB\-\-remove\-custom\-metadata\fR=[\fIMETADATA_KEYS\fR,...]\ \fB\-\-update\-custom\-metadata\fR=[\fICUSTOM_METADATA_KEYS_AND_VALUES\fR,...]] [\fB\-\-if\-generation\-match\fR=\fIGENERATION\fR\ \fB\-\-if\-metageneration\-match\fR=\fIMETAGENERATION\fR] [\fB\-\-retain\-until\fR=\fIDATETIME\fR\ \fB\-\-retention\-mode\fR=\fIRETENTION_MODE\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

The mv command allows you to move data between your local file system and the
cloud, move data within the cloud, and move data between cloud storage
providers.

\fBRenaming Groups Of Objects\fR

You can use the mv command to rename all objects with a given prefix to have a
new prefix. For example, the following command renames all objects under
gs://my_bucket/oldprefix to be under gs://my_bucket/newprefix, otherwise
preserving the naming structure:

.RS 2m
$ gcloud storage mv gs://my_bucket/oldprefix gs://my_bucket/newprefix
.RE

Note that when using mv to rename groups of objects with a common prefix, you
cannot specify the source URL using wildcards; you must spell out the complete
name.

If you do a rename as specified above and you want to preserve ACLs.

\fBNon\-Atomic Operation\fR

Unlike the case with many file systems, the mv command does not perform a single
atomic operation. Rather, it performs a copy from source to destination followed
by removing the source for each object.

A consequence of this is that, in addition to normal network and operation
charges, if you move a Nearline Storage, Coldline Storage, or Archive Storage
object, deletion and data retrieval charges apply. See the documentation for
pricing details.



.SH "EXAMPLES"

To move all objects from a bucket to a local directory you could use:

.RS 2m
$ gcloud storage mv gs://my_bucket/* dir
.RE

Similarly, to move all objects from a local directory to a bucket you could use:

.RS 2m
$ gcloud storage mv ./dir gs://my_bucket
.RE

The following command renames all objects under gs://my_bucket/oldprefix to be
under gs://my_bucket/newprefix, otherwise preserving the naming structure:

.RS 2m
$ gcloud storage mv gs://my_bucket/oldprefix gs://my_bucket/newprefix
.RE



.SH "POSITIONAL ARGUMENTS"

.RS 2m
.TP 2m
[\fISOURCE\fR ...]

The source path(s) to copy.

.TP 2m
\fIDESTINATION\fR

The destination path.


.RE
.sp

.SH "FLAGS"

.RS 2m
.TP 2m
\fB\-\-additional\-headers\fR=\fIHEADER\fR=\fIVALUE\fR

Includes arbitrary headers in storage API calls. Accepts a comma separated list
of key=value pairs, e.g. \f5header1=value1,header2=value2\fR. Overrides the
default \fBstorage/additional_headers\fR property value for this command
invocation.

.TP 2m
\fB\-\-all\-versions\fR, \fB\-A\fR

Copy all source versions from a source bucket or folder. If not set, only the
live version of each source object is copied.

Note: This option is only useful when the destination bucket has Object
Versioning enabled. Additionally, the generation numbers of copied versions do
not necessarily match the order of the original generation numbers.

.TP 2m
\fB\-\-no\-clobber\fR, \fB\-n\fR

Do not overwrite existing files or objects at the destination. Skipped items
will be printed. This option may perform an additional GET request for cloud
objects before attempting an upload.

.TP 2m
\fB\-\-content\-md5\fR=\fIMD5_DIGEST\fR

Manually specified MD5 hash digest for the contents of an uploaded file. This
flag cannot be used when uploading multiple files. The custom digest is used by
the cloud provider for validation.

.TP 2m
\fB\-\-continue\-on\-error\fR, \fB\-c\fR

If any operations are unsuccessful, the command will exit with a non\-zero exit
status after completing the remaining operations. This flag takes effect only in
sequential execution mode (i.e. processor and thread count are set to 1).
Parallelism is default.

.TP 2m
\fB\-\-daisy\-chain\fR, \fB\-D\fR

Copy in "daisy chain" mode, which means copying an object by first downloading
it to the machine where the command is run, then uploading it to the destination
bucket. The default mode is a "copy in the cloud," where data is copied without
uploading or downloading. During a copy in the cloud, a source composite object
remains composite at its destination. However, you can use daisy chain mode to
change a composite object into a non\-composite object. Note: Daisy chain mode
is automatically used when copying between providers.

.TP 2m
\fB\-\-do\-not\-decompress\fR

Do not automatically decompress downloaded gzip files.

.TP 2m
\fB\-\-include\-managed\-folders\fR

Includes managed folders in command operations. For transfers, gcloud storage
will set up managed folders in the destination with the same IAM policy bindings
as the source. Managed folders are only included with recursive cloud\-to\-cloud
transfers. Please note that for hierarchical namespace buckets, managed folders
are always included. Hence this flag would not be applicable to hierarchical
namespace buckets.

.TP 2m
\fB\-\-manifest\-path\fR=\fIMANIFEST_PATH\fR, \fB\-L\fR \fIMANIFEST_PATH\fR

Outputs a manifest log file with detailed information about each item that was
copied. This manifest contains the following information for each item:

.RS 2m
.IP "\(em" 2m
Source path.
.IP "\(em" 2m
Destination path.
.IP "\(em" 2m
Source size.
.IP "\(em" 2m
Bytes transferred.
.IP "\(em" 2m
MD5 hash.
.IP "\(em" 2m
Transfer start time and date in UTC and ISO 8601 format.
.IP "\(em" 2m
Transfer completion time and date in UTC and ISO 8601 format.
.IP "\(em" 2m
Final result of the attempted transfer: OK, error, or skipped.
.IP "\(em" 2m
Details, if any.
.RE
.sp

If the manifest file already exists, gcloud storage appends log items to the
existing file.

Objects that are marked as "OK" or "skipped" in the existing manifest file are
not retried by future commands. Objects marked as "error" are retried.

.TP 2m
\fB\-\-preserve\-posix\fR, \fB\-P\fR

Causes POSIX attributes to be preserved when objects are copied. With this
feature enabled, gcloud storage will copy several fields provided by the stat
command: access time, modification time, owner UID, owner group GID, and the
mode (permissions) of the file.

For uploads, these attributes are read off of local files and stored in the
cloud as custom metadata. For downloads, custom cloud metadata is set as POSIX
attributes on files after they are downloaded.

On Windows, this flag will only set and restore access time and modification
time because Windows doesn't have a notion of POSIX UID, GID, and mode.

.TP 2m
\fB\-\-print\-created\-message\fR, \fB\-v\fR

Prints the version\-specific URL for each copied object.

.TP 2m
\fB\-\-read\-paths\-from\-stdin\fR, \fB\-I\fR

Read the list of resources to copy from stdin. No need to enter a source
argument if this flag is present. Example: "storage cp \-I
gs://bucket/destination" Note: To copy the contents of one file directly from
stdin, use "\-" as the source argument without the "\-I" flag.

.TP 2m
\fB\-\-skip\-unsupported\fR, \fB\-U\fR

Skip objects with unsupported object types.

.TP 2m
\fB\-\-storage\-class\fR=\fISTORAGE_CLASS\fR, \fB\-s\fR \fISTORAGE_CLASS\fR

Specify the storage class of the destination object. If not specified, the
default storage class of the destination bucket is used. This option is not
valid for copying to non\-cloud destinations.

.TP 2m
\fB\-\-canned\-acl\fR=\fIPREDEFINED_ACL\fR, \fB\-\-predefined\-acl\fR=\fIPREDEFINED_ACL\fR, \fB\-a\fR \fIPREDEFINED_ACL\fR

Applies predefined, or "canned," ACLs to a resource. See docs for a list of
predefined ACL constants:
https://cloud.google.com/storage/docs/access\-control/lists#predefined\-acl

.TP 2m
\fB\-\-[no\-]preserve\-acl\fR, \fB\-p\fR

Preserves ACLs when copying in the cloud. This option is Cloud Storage\-only,
and you need OWNER access to all copied objects. If all objects in the
destination bucket should have the same ACL, you can also set a default object
ACL on that bucket instead of using this flag. Preserving ACLs is the default
behavior for updating existing objects. Use \fB\-\-preserve\-acl\fR to enable
and \fB\-\-no\-preserve\-acl\fR to disable.

.TP 2m

At most one of these can be specified:


.RS 2m
.TP 2m
\fB\-\-gzip\-in\-flight\fR=[\fIFILE_EXTENSIONS\fR,...], \fB\-j\fR [\fIFILE_EXTENSIONS\fR,...]

Applies gzip transport encoding to any file upload whose extension matches the
input extension list. This is useful when uploading files with compressible
content such as .js, .css, or .html files. This also saves network bandwidth
while leaving the data uncompressed in Cloud Storage.

When you specify the \f5\-\-gzip\-in\-flight\fR option, files being uploaded are
compressed in\-memory and on\-the\-wire only. Both the local files and Cloud
Storage objects remain uncompressed. The uploaded objects retain the
\f5Content\-Type\fR and name of the original files.

.TP 2m
\fB\-\-gzip\-in\-flight\-all\fR, \fB\-J\fR

Applies gzip transport encoding to file uploads. This option works like the
\f5\-\-gzip\-in\-flight\fR option described above, but it applies to all
uploaded files, regardless of extension.

CAUTION: If some of the source files don't compress well, such as binary data,
using this option may result in longer uploads.

.TP 2m
\fB\-\-gzip\-local\fR=[\fIFILE_EXTENSIONS\fR,...], \fB\-z\fR [\fIFILE_EXTENSIONS\fR,...]

Applies gzip content encoding to any file upload whose extension matches the
input extension list. This is useful when uploading files with compressible
content such as .js, .css, or .html files. This saves network bandwidth and
space in Cloud Storage.

When you specify the \f5\-\-gzip\-local\fR option, the data from files is
compressed before it is uploaded, but the original files are left uncompressed
on the local disk. The uploaded objects retain the \f5Content\-Type\fR and name
of the original files. However, the \f5Content\-Encoding\fR metadata is set to
\f5gzip\fR and the \f5Cache\-Control\fR metadata set to \f5no\-transform\fR. The
data remains compressed on Cloud Storage servers and will not be decompressed on
download by gcloud storage because of the \f5no\-transform\fR field.

Since the local gzip option compresses data prior to upload, it is not subject
to the same compression buffer bottleneck of the in\-flight gzip option.

.TP 2m
\fB\-\-gzip\-local\-all\fR, \fB\-Z\fR

Applies gzip content encoding to file uploads. This option works like the
\f5\-\-gzip\-local\fR option described above, but it applies to all uploaded
files, regardless of extension.

CAUTION: If some of the source files don't compress well, such as binary data,
using this option may result in files taking up more space in the cloud than
they would if left uncompressed.

.RE
.sp
.TP 2m

Flags to influence behavior when handling symlinks. Only one value may be set.

At most one of these can be specified:


.RS 2m
.TP 2m
\fB\-\-ignore\-symlinks\fR

Ignore file symlinks instead of copying what they point to.

.TP 2m
\fB\-\-preserve\-symlinks\fR

Preserve symlinks instead of copying what they point to. With this feature
enabled, uploaded symlinks will be represented as placeholders in the cloud
whose content consists of the linked path. Inversely, such placeholders will be
converted to symlinks when downloaded while this feature is enabled, as
described at
https://cloud.google.com/storage\-transfer/docs/metadata\-preservation#posix_to.

Directory symlinks are only followed if this flag is specified.

CAUTION: No validation is applied to the symlink target paths. Once downloaded,
preserved symlinks will point to whatever path was specified by the placeholder,
regardless of the location or permissions of the path, or whether it actually
exists.

This feature is not supported on Windows.


.RE
.RE
.sp

.SH "ENCRYPTION FLAGS"

.RS 2m
.TP 2m
\fB\-\-decryption\-keys\fR=[\fIDECRYPTION_KEY\fR,...]

A comma\-separated list of customer\-supplied encryption keys (RFC 4648 section
4 base64\-encoded AES256 strings) that will be used to decrypt Cloud Storage
objects. Data encrypted with a customer\-managed encryption key (CMEK) is
decrypted automatically, so CMEKs do not need to be listed here.

.TP 2m
\fB\-\-encryption\-key\fR=\fIENCRYPTION_KEY\fR

The encryption key to use for encrypting target objects. The specified
encryption key can be a customer\-supplied encryption key (An RFC 4648 section 4
base64\-encoded AES256 string), or a customer\-managed encryption key of the
form
\f5projects/{project}/locations/{location}/keyRings/{key\-ring}/cryptoKeys/{crypto\-key}\fR.
The specified key also acts as a decryption key, which is useful when copying or
moving encrypted data to a new location. Using this flag in an \f5objects
update\fR command triggers a rewrite of target objects.


.RE
.sp

.SH "OBJECT METADATA FLAGS"

.RS 2m
.TP 2m
\fB\-\-cache\-control\fR=\fICACHE_CONTROL\fR

How caches should handle requests and responses.

.TP 2m
\fB\-\-content\-disposition\fR=\fICONTENT_DISPOSITION\fR

How content should be displayed.

.TP 2m
\fB\-\-content\-encoding\fR=\fICONTENT_ENCODING\fR

How content is encoded (e.g. \f5\fIgzip\fR\fR).

.TP 2m
\fB\-\-content\-language\fR=\fICONTENT_LANGUAGE\fR

Content's language (e.g. \f5\fIen\fR\fR signifies "English").

.TP 2m
\fB\-\-content\-type\fR=\fICONTENT_TYPE\fR

Type of data contained in the object (e.g. \f5\fItext/html\fR\fR).

.TP 2m
\fB\-\-custom\-time\fR=\fICUSTOM_TIME\fR

Custom time for Cloud Storage objects in RFC 3339 format.

.TP 2m

At most one of these can be specified:


.RS 2m
.TP 2m
\fB\-\-clear\-custom\-metadata\fR

Clears all custom metadata on objects. When used with \f5\-\-preserve\-posix\fR,
POSIX attributes will still be stored in custom metadata.

.TP 2m
\fB\-\-custom\-metadata\fR=[\fICUSTOM_METADATA_KEYS_AND_VALUES\fR,...]

Sets custom metadata on objects. When used with \f5\-\-preserve\-posix\fR, POSIX
attributes are also stored in custom metadata.

.TP 2m

Flags that preserve unspecified existing metadata cannot be used with
\f5\-\-custom\-metadata\fR or \f5\-\-clear\-custom\-metadata\fR, but can be
specified together:


.RS 2m
.TP 2m
\fB\-\-remove\-custom\-metadata\fR=[\fIMETADATA_KEYS\fR,...]

Removes individual custom metadata keys from objects. This flag can be used with
\f5\-\-update\-custom\-metadata\fR. When used with \f5\-\-preserve\-posix\fR,
POSIX attributes specified by this flag are not preserved.

.TP 2m
\fB\-\-update\-custom\-metadata\fR=[\fICUSTOM_METADATA_KEYS_AND_VALUES\fR,...]

Adds or sets individual custom metadata key value pairs on objects. Existing
custom metadata not specified with this flag is not changed. This flag can be
used with \f5\-\-remove\-custom\-metadata\fR. When keys overlap with those
provided by \f5\-\-preserve\-posix\fR, values specified by this flag are used.


.RE
.RE
.RE
.sp

.SH "PRECONDITION FLAGS"

.RS 2m
.TP 2m
\fB\-\-if\-generation\-match\fR=\fIGENERATION\fR

Execute only if the generation matches the generation of the requested object.

.TP 2m
\fB\-\-if\-metageneration\-match\fR=\fIMETAGENERATION\fR

Execute only if the metageneration matches the metageneration of the requested
object.


.RE
.sp

.SH "RETENTION FLAGS"

.RS 2m
.TP 2m
\fB\-\-retain\-until\fR=\fIDATETIME\fR

Ensures the destination object is retained until the specified time in RFC 3339
format.

.TP 2m
\fB\-\-retention\-mode\fR=\fIRETENTION_MODE\fR

Sets the destination object retention mode to either "Locked" or "Unlocked".
When retention mode is "Locked", the retain until time can only be increased.
\fIRETENTION_MODE\fR must be one of: \fBLocked\fR, \fBUnlocked\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 variant is also available:

.RS 2m
$ gcloud alpha storage mv
.RE