gsutil is a Python application that lets you access Google 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.
Contents
Getting Started
Accessing Publicly Accessible Data
To get started using gsutil, you can simply download and install the application, and use it to access publicly-accessible data. You do not need to sign up for a Google Cloud Storage or a Google account to use gsutil for this purpose.
For example, you can download and install the gsutil client and run the following command to download data from a publicly-accessible bucket called
uspto
:
gsutil ls gs://uspto-pair/applications/0800401*
You should see a listing of objects whose name starts with
gs://uspto-pair/applications/0800401
.
Reading and Writing Data as an Authenticated User
If you would like to use gsutil to access objects and buckets that are protected, you need to authenticate to Google Cloud Storage. You can do so in one of two ways, depending on your use case:
-
Reading and Writing Protected Data using your Google Account
If another individual has already set up a Google Cloud Storage account and has added you to the project as a team member, or if you have been added to an object's or bucket's ACLs, you do not need to activate Google Cloud Storage to access the specified data. Download and install the application and authenticate to the Google Cloud Storage service to access the protected data. You do not need to set up billing.
-
Creating a New Instance of Google Cloud Storage
If you would like to create a new instance of Google Cloud Storage, you need to activate the Google Cloud Storage service and set up billing . After you have signed up for the Google Cloud Storage service, download and install gsutil and authenticate to the Google Cloud Storage service to begin using Google Cloud Storage.
Built-In Help
gsutil contains thorough built-in help about every command as well as a number of topics, which you can get by running:
gsutil helpThis command will output a list of all commands and available help topics, and you can then get detailed help for each command or topic. For example, you can get help about the gsutil cp command by running:
gsutil help cp
The gsutil help pages are also available online in the sidebar. For example, the cp help page is available here .
About gsutil
gsutil is an open-source project. To download the developer version of gsutil or volunteer to help develop gsutil, visit the gsutil project on GitHub.