Example Cloud Storage operations

Virtual Storage Platform One SDS Cloud for Google Cloud Platform Setup and Configuration

Version
1.18.x
Audience
anonymous
Part Number
MK-24VSP1SDS011-02

This is used for copying or uploading files, for example.

For details about options, see the gcloud CLI documentation.

  • List buckets and objects

    Syntax
    gsutil ls <target> [-options]
    Example

    The following example shows all buckets in a list.

    $ gsutil ls
    gs://my-sdsc-bucket/
    gs://my-sdsc-bucket2/

    The following example shows all objects in the bucket in a list.

    $ gsutil ls gs://my-sdsc-bucket/
    gs://my-sdsc-bucket/test.txt
    gs://my-sdsc-bucket/test2.txt
    gs://my-sdsc-bucket/folder1/
  • Copy objects

    Syntax
    gsutil cp <source> <target> [-options]
    Example

    The following example copies a file (test.txt) from your bucket (my-sdsc-bucket) to your current working directory.

    gsutil cp gs://my-sdsc-bucket/test.txt .

    The following example copies a file (test2.txt) to your bucket (my-sdsc-bucket).

    gsutil cp test2.txt gs://my-sdsc-bucket