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_alpha_storage_rm.1
.TH "GCLOUD_ALPHA_STORAGE_RM" 1



.SH "NAME"
.HP
gcloud alpha storage rm \- delete objects and buckets



.SH "SYNOPSIS"
.HP
\f5gcloud alpha storage rm\fR [\fIURLS\fR\ ...] [\fB\-\-additional\-headers\fR=\fIHEADER\fR=\fIVALUE\fR] [\fB\-\-all\-versions\fR,\ \fB\-a\fR] [\fB\-\-continue\-on\-error\fR,\ \fB\-c\fR] [\fB\-\-exclude\-managed\-folders\fR] [\fB\-\-read\-paths\-from\-stdin\fR,\ \fB\-I\fR] [\fB\-\-recursive\fR,\ \fB\-R\fR,\ \fB\-r\fR] [\fB\-\-if\-generation\-match\fR=\fIGENERATION\fR\ \fB\-\-if\-metageneration\-match\fR=\fIMETAGENERATION\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

\fB(ALPHA)\fR Delete objects and buckets.



.SH "EXAMPLES"

The following command deletes a Cloud Storage object named
\f5\fImy\-object\fR\fR from the bucket \f5\fImy\-bucket\fR\fR:

.RS 2m
$ gcloud alpha storage rm gs://my\-bucket/my\-object
.RE

The following command deletes all objects directly within the directory
\f5\fImy\-dir\fR\fR but no objects within subdirectories:

.RS 2m
$ gcloud alpha storage rm gs://my\-bucket/my\-dir/*
.RE

The following command deletes all objects and subdirectories within the
directory \f5\fImy\-dir\fR\fR:

.RS 2m
$ gcloud alpha storage rm gs://my\-bucket/my\-dir/**
.RE

Note that for buckets that contain versioned objects
(https://cloud.google.com/storage/docs/object\-versioning), the above command
only affects live versions. Use the \f5\-\-recursive\fR flag instead to delete
all versions.

The following command deletes all versions of all resources in
\f5\fImy\-bucket\fR\fR and then deletes the bucket.

.RS 2m
$ gcloud alpha storage rm \-\-recursive gs://my\-bucket/
.RE

The following command deletes all text files in the top\-level of
\f5\fImy\-bucket\fR\fR, but not text files in subdirectories:

.RS 2m
$ gcloud alpha storage rm \-recursive gs://my\-bucket/*.txt
.RE

The following command deletes one wildcard expression per line passed in by
stdin:

.RS 2m
$ some_program | gcloud alpha storage rm \-I
.RE



.SH "POSITIONAL ARGUMENTS"

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

The URLs of the resources to delete.


.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

Delete all versions (https://cloud.google.com/storage/docs/object\-versioning)
of an object.

.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\-\-exclude\-managed\-folders\fR

Excludes managed folders from command operations. By default gcloud storage
includes managed folders in recursive removals. Please note that this flag would
not be applicable for hierarchical namespace buckets as we always list managed
folders for these buckets.

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

Read the list of URLs from stdin.

.TP 2m
\fB\-\-recursive\fR, \fB\-R\fR, \fB\-r\fR

Recursively delete the contents of buckets or directories that match the path
expression. By default, this will delete managed folders as well. If the path is
set to a bucket, like \f5\fIgs://bucket\fR\fR, the bucket is also deleted. This
option implies the \f5\-\-all\-versions\fR option. If you want to delete only
live object versions, use the ``**'' wildcard instead.


.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 "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 alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation\-only early access
allowlist. This variant is also available:

.RS 2m
$ gcloud storage rm
.RE