Files
doc-exports/docs/obs/tool-obsutil/obs_11_0006.html
weihongmin1 c4291b1dd5 OBS Util 0309 Verion
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com>
Co-authored-by: weihongmin1 <weihongmin1@huawei.com>
Co-committed-by: weihongmin1 <weihongmin1@huawei.com>
2026-03-27 12:15:19 +00:00

5.8 KiB

Quick Start

This section uses Linux as an example to describe how to use obsutil to perform basic operations in OBS.

Prerequisites

  • You have obtained obsutil and completed initial configuration.
  • You are in the directory where obsutil is located.

Procedure

  1. Run the ./obsutil mb obs://bucket-test command to create a bucket named bucket-test in the region.

    ./obsutil mb obs://bucket-test
    
    Create bucket [bucket-test] successfully!

  2. Run the ./obsutil cp /temp/test.txt obs://bucket-test/test.txt command to upload the test.txt file to bucket bucket-test.

    ./obsutil cp /temp/test.txt obs://bucket-test/test.txt
    
    Parallel:      5                   Jobs:          5
    Threshold:     52428800            PartSize:      5242880
    VerifyLength:  false               VerifyMd5:     false
    CheckpointDir: /temp/.obsutil_checkpoint
    
    test.txt:[==============================================] 100.00% 48.47 KB/s 0s
    Upload successfully, 4.44KB, /temp/test.txt --> obs://bucket-test1/test.txt

    To upload local folder test to the OBS bucket, run the following command:

    ./obsutil cp /test/ obs://bucket-test -r -f

  3. Run the ./obsutil cp obs://bucket-test/test.txt /temp/test1.txt command to download test.txt from bucket bucket-test to a local PC.

    ./obsutil cp obs://bucket-test/test.txt /temp/test1.txt
    
    Parallel:      5                   Jobs:          5
    Threshold:     52428800            PartSize:      5242880
    VerifyLength:  false               VerifyMd5:     false
    CheckpointDir: /temp/.obsutil_checkpoint
    
    test.txt:[=============================================] 100.00% 775.52 KB/s 0s
    Download successfully, 4.44KB, obs://bucket-test1/test.txt --> /temp/test1.txt

    To download directory test from the OBS bucket to the local folder temp, run the following command:

    ./obsutil cp obs://bucket-test/test /temp -r -f

  4. Run the ./obsutil rm obs://bucket-test/test.txt -f command to delete object test.txt from bucket bucket-test.

    ./obsutil rm obs://bucket-test/test.txt -f
    
    Delete object [test.txt] in the bucket [bucket-test] successfully!

  5. Run the ./obsutil rm obs://bucket-test -f command to delete bucket bucket-test.

    ./obsutil rm obs://bucket-test -f
    
    Delete bucket [bucket-test] successfully!