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.
Accessing Publicly Accessible Data
To get started using gsutil, you can simply download and install the Google Cloud SDK, which contains gsutil as one of its components. You can immediately use gsutil to access 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.
For example, once you have gsutil you can run the following command to
download data from a publicly accessible bucket called
gsutil ls gs://uspto-pair/applications/0800401*
You should see a listing of objects whose name starts with
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 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 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 can get gsutil as part of the Google Cloud SDK and then authenticate to the Cloud Storage service to access the protected data. You do not need to activate Cloud Storage or set up billing.
- Activating Cloud Storage
If you would like to create your own buckets or control data access in Cloud Storage, you need to:
Sign in to your Google account.
If you don't already have one, sign up for a new account.
- Select or create a Cloud Platform Console project.
- Enable billing for your project.
After you have signed up for the Cloud Storage service:
- Sign in to your Google account.
gsutil contains thorough built-in help about every command as well as a number of topics, which you can get by running:
This command outputs 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
To get information about gsutil top-level command-line options, use:
gsutil help options
To get information about your gsutil installation, use:
gsutil version -l
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.