Stay organized with collections Save and categorize content based on your preferences.
gcloud storage ls
[PATH
…] [--additional-headers
=HEADER
=VALUE
] [--all-versions
, -a
] [--buckets
, -b
] [--etag
, -e
] [--exhaustive
] [--fetch-encrypted-object-hashes
] [--format
=FORMAT
] [--next-page-token
=NEXT_PAGE_TOKEN
] [--read-paths-from-stdin
, -I
] [--readable-sizes
] [--recursive
, -R
, -r
] [--soft-deleted
] [--full
, -L
| --json
, -j
| --long
, -l
] [--decryption-keys
=[DECRYPTION_KEY
,…]] [GCLOUD_WIDE_FLAG …
]
gcloud storage ls
The following command lists the buckets in the specified project:
gcloud storage ls --project=my-project
The following command lists the contents of a bucket:
gcloud storage ls gs://my-bucket
You can use wildcards to match multiple paths (including multiple buckets). Bucket wildcards are expanded to match only buckets contained in your current project. The following command matches
objects that begin with .txt
and that are stored in buckets in your project that begin with log
:my-b
gcloud storage ls gs://my-b*/log*.txt
You can use double-star wildcards to match zero or more directory levels in a path. The following command matches all
objects in a bucket..txt
gcloud storage ls gs://my-bucket/**/*.txt
The wildcard **
retrieves a flat list of objects in a single API call and does not match prefixes. The following command would not match gs://my-bucket/dir/log.txt
:
gcloud storage ls gs://my-bucket/**/dir
Double-star expansion also can not be combined with other expressions in a given path segment and operates as a single star in that context. For example, the command gs://my-bucket/dir**/log.txt
is treated as gs://my-bucket/dir*/log.txt
. To get the recursive behavior, the command should instead be written the following way:
gs://my-bucket/dir*/**/log.txt
The following command lists all items recursively with formatting by using --recursive
:
gcloud storage ls --recursive gs://bucket
Recursive listings are similar to **
except recursive listings include line breaks and header formatting for each subdirectory.
PATH
…]
header1=value1,header2=value2
. Overrides the default storage/additional_headers
property value for this command invocation.
--all-versions
, -a
--long
option, the metageneration for each listed object is also included.
--buckets
, -b
--full
to get the full metadata of buckets.
--etag
, -e
--long
flag.
--exhaustive
--fetch-encrypted-object-hashes
--format
=FORMAT
--next-page-token
=NEXT_PAGE_TOKEN
--read-paths-from-stdin
, -I
--readable-sizes
--long
, print object sizes in human readable format, such as 1 KiB, 234 MiB, or 2 GiB.
--recursive
, -R
, -r
--soft-deleted
--full
, -L
--json
, -j
--long
, -l
--decryption-keys
=[DECRYPTION_KEY
,…]
--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.
gcloud alpha storage ls
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-22 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-22 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.5