gsutil tool Stay organized with collections Save and categorize content based on your preferences.
gcloud storage commands in the Google Cloud CLI instead.gsutil is a Python application that lets you access Cloud Storage from thecommand line. You can use gsutil to do a wide range of bucket and objectmanagement tasks, including:
- Creating and deleting buckets.
- Uploading, downloading, and deleting objects.
- Listing buckets and objects.
- Moving, copying, and renaming objects.
- Editing object and bucket ACLs.
gsutil performs all operations, including uploads and downloads, using HTTPSand transport-layer security (TLS).
Should you use gsutil?
Generally, you shouldusegcloud storage commands instead ofgsutilcommands:
The gsutil tool is a legacy Cloud Storage CLI and minimallymaintained.
The gsutil tool does not support working with newer Cloud Storagefeatures, such assoft delete andmanaged folders.
gcloud storagecommands require less manual optimization in order to achievethe fastest upload and download rates.
Migrating to the gcloud CLI
If you are a gsutil user wanting to migrate to the gcloud CLI, youshould first check if you're using a standalone version of gsutil by runningthe following command:
gsutil version -l
If the result of the command includes
using cloud sdk: False, then you areusing a standalone version of gsutil. To migrate to the gcloud CLI,start byInstalling the gcloud CLI.If the result of the command includes
using cloud sdk: True, then youalready have the gcloud CLI installed.
Once the gcloud CLI is installed, you can usegcloud storagecommands just like you usegsutil commands. The following resources can helpyou get started:
Explore
gcloud storagecommands by following the quickstartDiscover object storage with gcloud CLI.Read the
gcloud storagereference.Review theShim for running
gcloud storage, which documentsfunctionality that's not available ingcloud storagecommands.
Syntax for accessing resources
gsutil uses the prefixgs:// to indicate a resource in Cloud Storage:
gs://BUCKET_NAME/OBJECT_NAME
In addition to specifying exact resources, gsutil supports the use ofwildcards in your commands.
Accessing a file list
For operations involving a large number of files, you can pass a list of sourcefiles to gsutil by using the-I flag. This tells gsutil to read the list offiles or object URLs from stdin rather than from the command-line arguments.
The input must be a list of local file paths or Cloud Storage object URLs,with one path per line. For example, you can create a file namedexample_file_list.txt that contains the following paths:
gs://example-source-bucket/data-01.csvgs://example-source-bucket/images/logo.png/local/logs/error_log_20251226.txt
The following example commands read the file paths fromexample_file_list.txtand copy them to a destination bucket namedgs://example-destination-bucket:
catexample_file_list.txt|gsutil-mcp-Igs://example-destination-bucket/You can also generate the list of paths on the fly and pipe it directly intogsutil. For example, the following commands upload all JPG files found in yourcurrent directory and copy them togs://example-destination-bucket:
find.-name"*.jpg"|gsutil-mcp-Igs://example-destination-bucket
Built-in help
gsutil contains thorough built-in help about every command as well as a numberof topics, which you can list and read with thegsutil help command.
To get information about a specific command or topic, usegsutil help followedby the intended command or topic name. For example,gsutil help cp andgsutil help options are a command help page and a topic help page,respectively.
To get information about your gsutil installation, use thegsutil versioncommand:
gsutil version -l
Usage statistics
During the installation process, you can opt-in to tracking usage statisticswhich helps improve the gsutil tool. If you subsequently decide that you want todisable these usage statistics, seeUsage statistics.
About gsutil
gsutil is an open-source project. To download the developer version of gsutilorvolunteer to help develop gsutil, visit thegsutil project onGitHub.
Limitations
- When using gsutil with Windows, commands that use the
-mglobal flagcannot be canceled usingCtrl-C.
What's next
- Install gsutil.
- See community discussion ingsutil Stack Overflow questions.
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 2026-02-19 UTC.