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_du.1
.TH "GCLOUD_STORAGE_DU" 1



.SH "NAME"
.HP
gcloud storage du \- displays the amount of space in bytes used by storage resources



.SH "SYNOPSIS"
.HP
\f5gcloud storage du\fR [\fIURL\fR\ ...] [\fB\-\-additional\-headers\fR=\fIHEADER\fR=\fIVALUE\fR] [\fB\-\-all\-versions\fR,\ \fB\-a\fR] [\fB\-\-exclude\-name\-pattern\fR=\fIEXCLUDE_NAME_PATTERN\fR,\ \fB\-e\fR\ \fIEXCLUDE_NAME_PATTERN\fR] [\fB\-\-exclude\-name\-pattern\-file\fR=\fIEXCLUDE_NAME_PATTERN_FILE\fR,\ \fB\-X\fR\ \fIEXCLUDE_NAME_PATTERN_FILE\fR] [\fB\-\-readable\-sizes\fR,\ \fB\-r\fR] [\fB\-\-summarize\fR,\ \fB\-s\fR] [\fB\-\-total\fR,\ \fB\-c\fR] [\fB\-\-zero\-terminator\fR,\ \fB\-0\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

Displays the amount of space in bytes used by the objects in a bucket,
subdirectory, or project. This command calculates the current space usage by
making a series of object listing requests, which can take a long time for large
buckets. If your bucket contains hundreds of thousands of objects, or if you
want to monitor your bucket size over time, use Monitoring instead, as described
in Get bucket size (https://cloud.google.com/storage/docs/getting\-bucket\-size)



.SH "EXAMPLES"

To list the size of each object in a bucket:

.RS 2m
$ gcloud storage du gs://bucketname
.RE

To list the size of each object in the prefix subdirectory:

.RS 2m
$ gcloud storage du gs://bucketname/prefix/*
.RE

To print the total number of bytes in a bucket in human\-readable form:

.RS 2m
$ gcloud storage du \-c gs://bucketname
.RE

To see a summary of the total number of bytes in two given buckets:

.RS 2m
$ gcloud storage du \-s gs://bucket1 gs://bucket2
.RE

To list the size of each object in a bucket with Object Versioning enabled,
including noncurrent objects:

.RS 2m
$ gcloud storage du \-a gs://bucketname
.RE

To list the size of each object in a bucket, except objects that end in ".bak",
with each object printed ending in a null byte:

.RS 2m
$ gcloud storage du \-e "*.bak" \-0 gs://bucketname
.RE

To list the size of each bucket in a project and the total size of the project:

.RS 2m
$ gcloud storage du \-\-summarize \-\-readable\-sizes \-\-total
.RE



.SH "POSITIONAL ARGUMENTS"

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

The url of objects to list.


.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

Includes noncurrent object versions for a bucket with Object Versioning enabled.
Also prints the generation and metageneration number for each listed object.

.TP 2m
\fB\-\-exclude\-name\-pattern\fR=\fIEXCLUDE_NAME_PATTERN\fR, \fB\-e\fR \fIEXCLUDE_NAME_PATTERN\fR

Exclude a pattern from the report. Example: \f5\-e "*.o"\fR excludes any object
that ends in ".o". Can be specified multiple times.

.TP 2m
\fB\-\-exclude\-name\-pattern\-file\fR=\fIEXCLUDE_NAME_PATTERN_FILE\fR, \fB\-X\fR \fIEXCLUDE_NAME_PATTERN_FILE\fR

Similar to \-e, but excludes patterns from the given file. The patterns to
exclude should be listed one per line.

.TP 2m
\fB\-\-readable\-sizes\fR, \fB\-r\fR

Prints object sizes in human\-readable format. For example, 1 KiB, 234 MiB, or
2GiB.

.TP 2m
\fB\-\-summarize\fR, \fB\-s\fR

Displays only the summary for each argument.

.TP 2m
\fB\-\-total\fR, \fB\-c\fR

Includes a total size of all input sources.

.TP 2m
\fB\-\-zero\-terminator\fR, \fB\-0\fR

Ends each output line with a 0 byte rather than a newline. You can use this to
make the output machine\-readable.


.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 du
.RE