Forrest logo
tool overview
On this page you find all important commands for the CLI tool gsutil. If the command you are looking for is missing please ask our AI.

gsutil

Gsutil is a command line tool developed by Google to interact with Google Cloud Storage. It enables users to manage storage buckets and objects in the cloud. The tool is written in Python and supports Windows, macOS, and various Linux distributions.

Gsutil provides a comprehensive set of commands for performing operations such as uploading and downloading files to or from storage buckets, copying objects between buckets, creating and deleting buckets, setting access controls, and more. It also supports features like parallel uploads and downloads, resumable transfers, and performance optimizations.

The tool integrates seamlessly with other Google Cloud services and can be used to configure storage lifecycle policies, manage access control lists (ACLs), and perform bulk operations efficiently. It uses OAuth 2.0 authentication to access resources, ensuring secure and authorized operations.

Gsutil offers a flexible and powerful scripting interface, allowing users to automate tasks and build complex workflows using commands and flags. It supports wildcard syntax for batch operations and uses cloud streaming capabilities to efficiently transfer large files.

The tool provides detailed logging and error reporting, allowing users to track and troubleshoot any issues that arise during operations. It also offers advanced features like rate limiting, bandwidth throttling, and checksum validation for data integrity.

With gsutil, users can easily interact with Google Cloud Storage from the command line, making it a valuable tool for developers, system administrators, and data engineers working on Google Cloud Platform.

List of commands for gsutil:

  • gsutil:tldr:3559f gsutil: Rename or move objects in a bucket.
    $ gsutil mv gs://${bucket_name}/${old_object_name} gs://${bucket_name}/${new_object_name}
    try on your machine
    explain this command
  • gsutil:tldr:6cbcf gsutil: Upload an object to a bucket.
    $ gsutil cp ${object_location} gs://${destination_bucket_name}/
    try on your machine
    explain this command
  • gsutil:tldr:9a3d0 gsutil: Download an object from a bucket.
    $ gsutil cp gs://${bucket_name}/${object_name} ${path-to-save_location}
    try on your machine
    explain this command
  • gsutil:tldr:9d5a6 gsutil: List all buckets in a project you are logged into.
    $ gsutil ls
    try on your machine
    explain this command
  • gsutil:tldr:d1d0b gsutil: Create a new bucket in the project you are logged into.
    $ gsutil mb gs://${bucket_name}
    try on your machine
    explain this command
  • gsutil:tldr:e16c8 gsutil: List the objects in a bucket.
    $ gsutil ls -r 'gs://${bucket_name}/${prefix}**'
    try on your machine
    explain this command
  • gsutil:tldr:f8e55 gsutil: Delete a bucket and remove all the objects in it.
    $ gsutil rm -r gs://${bucket_name}
    try on your machine
    explain this command
tool overview