gcloud storage objects list

NAME
gcloud storage objects list - lists Cloud Storage objects
SYNOPSIS
gcloud storage objects listURLS[URLS …][--additional-headers=HEADER=VALUE][--exhaustive][--fetch-encrypted-object-hashes][--next-page-token=NEXT_PAGE_TOKEN][--raw][--soft-deleted][--stat][--decryption-keys=[DECRYPTION_KEY,…]][--filter=EXPRESSION][--limit=LIMIT][--page-size=PAGE_SIZE][--sort-by=[FIELD,…]][--uri][GCLOUD_WIDE_FLAG]
DESCRIPTION
List Cloud Storage objects.

Bucket URLs likegs://bucket match all the objects inside a bucket,butgs://b* fails because it matches a list of buckets.

EXAMPLES
List all objects in bucketmy-bucket withincurrent directory level:
gcloudstorageobjectslistgs://my-bucket

List all objects across nested directories using wildcards(https://cloud.google.com/storage/docs/wildcards):

gcloudstorageobjectslistgs://my-bucket/**

List all objects in bucket beginning with ``o´´, including objectsacross nested directories:

gcloudstorageobjectslistgs://my-bucket/**/o*

List all objects within current directory of bucket with JSON formatting, onlyreturning the value of thename metadatafield:

gcloudstorageobjectslistgs://my-bucket--format="json(name)"
POSITIONAL ARGUMENTS
URLS [URLS …]
Specifies URL of objects to list.
FLAGS
--additional-headers=HEADER=VALUE
Includes arbitrary headers in storage API calls. Accepts a comma separated listof key=value pairs, e.g.header1=value1,header2=value2. Overridesthe defaultstorage/additional_headers property value for thiscommand invocation.
--exhaustive
For features like soft delete, the API may return an empty list. If present,continue querying. This may incur costs from repeated LIST calls and may notreturn any additional objects.
--fetch-encrypted-object-hashes
API requests to the LIST endpoint do not fetch the hashes for encrypted objectsby default. If this flag is set, a GET request is sent for each encrypted objectin order to fetch hashes. This can significantly increase the cost of thecommand.
--next-page-token=NEXT_PAGE_TOKEN
Page token for resuming LIST calls.
--raw
Shows metadata in the format returned by the API instead of standardizing it.
--soft-deleted
Displays soft-deleted resources only. For objects, it will exclude live andnoncurrent ones.
--stat
Emulates gsutil stat-style behavior. Does not show past object versions andchanges output format.
ENCRYPTION FLAGS
--decryption-keys=[DECRYPTION_KEY,…]
A comma-separated list of customer-supplied encryption keys (RFC 4648 section 4base64-encoded AES256 strings) that will be used to decrypt Cloud Storageobjects. Data encrypted with a customer-managed encryption key (CMEK) isdecrypted automatically, so CMEKs do not need to be listed here.
LIST COMMAND FLAGS
--filter=EXPRESSION
Apply a Boolean filterEXPRESSION to each resource itemto be listed. If the expression evaluatesTrue, then that item islisted. For more details and examples of filter expressions, run $gcloud topic filters. This flaginteracts with other flags that are applied in this order:--flatten,--sort-by,--filter,--limit.
--limit=LIMIT
Maximum number of resources to list. The default isunlimited. Thisflag interacts with other flags that are applied in this order:--flatten,--sort-by,--filter,--limit.
--page-size=PAGE_SIZE
Some services group resource list output into pages. This flag specifies themaximum number of resources per page. The default is determined by the serviceif it supports paging, otherwise it isunlimited (no paging).Paging may be applied before or after--filter and--limit depending on the service.
--sort-by=[FIELD,…]
Comma-separated list of resource field key names to sort by. The default orderis ascending. Prefix a field with ``~´´ for descending order on thatfield. This flag interacts with other flags that are applied in this order:--flatten,--sort-by,--filter,--limit.
--uri
Print a list of resource URIs instead of the default output, and change thecommand output to a list of URIs. If this flag is used with--format, the formatting is applied on this URI list. To displayURIs alongside other keys instead, use theuri() transform.
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$gcloud help for details.

NOTES
This variant is also available:
gcloudalphastorageobjectslist

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-11-11 UTC.