All Products
Search
Document Center

Object Storage Service:lrb (List buckets in a region)

Last Updated:Mar 20, 2026

Run ossutil lrb to list buckets across one or more regions. The output includes each bucket's name, creation time, storage class, and region, plus a total count.

Prerequisites

Before you begin, make sure you have:

Syntax

ossutil lrb conf_file [-e <endpoint>]
Parameter/OptionDescription
conf_filePath to a local file listing endpoints, one per line. Use this to query multiple regions in a single command.
-eEndpoint of the target region. Use this to query a single region without a configuration file.

Examples

List buckets in a single region

To query the China (Hangzhou) region explicitly:

ossutil lrb -e oss-cn-hangzhou.aliyuncs.com

To query the region configured in your ossutil configuration file:

ossutil lrb

For details on setting the endpoint in the configuration file, see config.

List buckets across multiple regions

  1. Create a local file that lists one endpoint per line. For example, create localfile.txt with the following content:

       oss-cn-hangzhou.aliyuncs.com
       oss-cn-shenzhen.aliyuncs.com
       oss-cn-shanghai.aliyuncs.com
  2. Pass the file to lrb:

       ossutil lrb localfile.txt

Sample output

A successful run prints one row per bucket, followed by the total count and elapsed time:

CreationTime                                 Region    StorageClass    BucketName
2021-07-06 14:21:09 +0800 CST       oss-cn-hangzhou        Standard    oss://examplebucket1
2021-07-06 14:21:44 +0800 CST       oss-cn-hangzhou        Standard    oss://examplebucket2
2021-06-16 18:32:32 +0800 CST       oss-cn-shanghai        Standard    oss://examplebucket3
2021-06-30 16:04:41 +0800 CST       oss-cn-shanghai        Standard    oss://examplebucket4
2021-07-07 12:33:35 +0800 CST       oss-cn-shenzhen        Standard    oss://examplebucket5

Bucket Number is: 5
0.124193(s) elapsed

The output columns are:

ColumnDescription
CreationTimeBucket creation timestamp (UTC+8)
RegionRegion identifier (endpoint prefix)
StorageClassStorage class of the bucket, such as Standard
BucketNameBucket name in oss:// format

Common options

To query buckets in a different region or under a different Alibaba Cloud account, add the relevant options to the command:

OptionDescription
-eEndpoint of the target region
-iAccessKey ID of the target account
-kAccessKey secret of the target account

The following command lists buckets in the China (Shanghai) region under a different account:

ossutil lrb -e oss-cn-shanghai.aliyuncs.com -i yourAccessKeyID -k yourAccessKeySecret

For a full list of common options, see Common options.