gsutil is a Python application that lets you access Cloud Storage from the command line. You can use gsutil to do a wide range of bucket and object management 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 HTTPS and transport-layer security (TLS).
Should you use gsutil?
Generally, you should use
gcloud storage commands instead of
The gsutil tool is a legacy Cloud Storage CLI and minimally maintained.
The gsutil tool does not support working with newer Cloud Storage features.
gcloud storagecommands require less manual optimization in order to achieve the fastest upload and download rates.
The best way to get started with the gsutil tool is to follow the gsutil Quickstart. The quickstart shows you how to set up a Google Cloud project, enable billing, install gsutil, and run basic commands with the tool.
If another individual has already set up a Cloud Storage account and has added you to the project as a team member, or if you have been granted access to an object or bucket, you can get gsutil as part of the Google Cloud CLI to access the protected data. You do not need to activate Cloud Storage or set up billing.
Accessing public data
If you only want to access public data, follow the instructions in Accessing Public Data. By following the steps found in the gsutil tab, you can immediately access freely available, publicly accessible data; you do not need to sign up for a Google account or authenticate to Cloud Storage to use gsutil for this purpose.
Syntax for accessing resources
gsutil uses the prefix
gs:// to indicate a resource in Cloud Storage:
In addition to specifying exact resources, gsutil supports the use of wildcards in your commands.
gsutil contains thorough built-in help about every command as well as a number
of topics, which you can list and read with the
gsutil help command.
To get information about your gsutil installation, use the gsutil version command:
gsutil version -l
During the installation process, you can opt-in to tracking usage statistics which helps improve the gsutil tool. If you susbequently decide that you want to disable these usage statistics, see Usage statistics.
- When using gsutil with Windows, commands that use the
-mglobal flag cannot be canceled using
- Install gsutil.
- Complete basic Cloud Storage tasks in the gsutil quickstart.
- See community discussion in gsutil Stack Overflow questions.