Playing with gsutil - Cloud Storage from Command Line | Scribe

    Playing with gsutil - Cloud Storage from Command Line

    • Hafeez Baig |
    • 14 steps |
    • 37 seconds
    1
    Sign in to the **Google Cloud Console**
    2
    On the top right corner click on the **Cloud Shell** widget
    information ordinal icon
    **What is Cloud Shell?**\ \ **Cloud Shell** is a web-based terminal provided by Google Cloud that offers a pre-configured environment with tools and utilities to manage Google Cloud resources directly from your browser.
    3
    **Cloud Shell Terminal** horizontal wizard will open, on the right side click on the **Open in new window** wizard
    4
    Wait for the Cloud Shell machine to be provisioned
    5
    **Cloud Shell Editor** wizard will open
    6
    Go back to the **Google Cloud console** tab
    7
    Click on the **in28minutes-project-4** dropdown wizard
    8
    **Select a project** wizard will open, copy the **ID** of the Name **in28minutes-project-4**
    9
    Go back to the **Cloud Shell** tab
    10
    Type the command "**gcloud config set project in28minutes-project-4**"
    information ordinal icon
    **What is command "gcloud config set project in28minutes-project-4"?**\ \ The command `gcloud config set project in28minutes-project-4` sets the default Google Cloud project for the `gcloud` command-line tool to `in28minutes-project-4`. This means that subsequent `gcloud` commands will operate on resources within this specified project unless another project is explicitly mentioned.
    11
    **Authorize Cloud Shell** wizard will open, click on the **Authorize** button
    12
    Type the command "**gsutil mb gs://my_bucket_in28minutes_shell_new**" **Note:** The bucket name should be unique.
    information ordinal icon
    **What is command "gsutil mb gs://my_bucket_in28minutes_shell_new"?**\ \ The command `gsutil mb gs://my_bucket_in28minutes_shell_new` creates a new Google Cloud Storage bucket named `my_bucket_in28minutes_shell_new`. The `mb` stands for "make bucket," and `gs://` is the URI scheme used to reference Google Cloud Storage resources. This command initializes the bucket with the specified name in your Google Cloud project.
    13
    The creation of bucket will initialize **Note:** It will take sometime for bucket creation.
    14
    Type the command "**gsutil ls gs://my_bucket_in28minutes_shell_new**" **Note:** This command will list all the contents of the bucket.
    information ordinal icon
    **What is command "gsutil ls gs://my_bucket_in28minutes_shell_new"?** The command `gsutil ls gs://my_bucket_in28minutes_shell_new` is used to list the contents of a specific Google Cloud Storage bucket named `my_bucket_in28minutes_shell_new`. By executing this command, you can view all the files and subdirectories within the bucket, helping you easily check what is stored there.
    information ordinal icon
    Congratulations! on completing this lab and Playing with gsutil - Cloud Storage from Command Line