对象存储服务 OBS-列举对象:运行示例

时间:2024-12-11 17:17:47

运行示例

  • 示例1:以Windows操作系统为例,运行obsutil ls obs://bucket-test -limit=10,查询桶内对象。
    obsutil ls obs://bucket-test -limit=10
    Start at 2024-09-30 08:18:50.0592788 +0000 UTC
    
    Listing objects .
    
    Folder list:
    obs://bucket-test/api/
    
    Object list:
    key                                               LastModified                  Size      StorageClass        ETag                
    obs://bucket-test/AUTHORS                         2018-11-16T02:15:49Z          33243     standard            "796393c1eaf502ef56a85c2ceb640aea"
    
    obs://bucket-test/CONTRIBUTING.md                 2018-11-16T02:15:49Z          1366      standard            "12d93325ba6131f852daecd18dd65edc"
    
    obs://bucket-test/CONTRIBUTORS                    2018-11-16T02:15:49Z          45710     standard            "b486b5003e6215c9199e86ab3ccec9fa"
    
    obs://bucket-test/LICENSE                         2018-11-16T02:15:49Z          1479      standard            "5d4950ecb7b26d2c5e4e7b4e0dd74707"
    
    obs://bucket-test/PATENTS                         2018-11-16T02:15:49Z          1303      standard            "3a55d95595a6f9e37dee53826b4daff2"
    
    obs://bucket-test/README.md                       2018-11-16T02:15:49Z          1399      standard            "97351fd7946b9ea021a31a86ba2a10ab"
    
    obs://bucket-test/VERSION                         2018-11-16T02:15:49Z          7         standard            "43d93b553855b0e1fc67e31c28c07b65"
    
    obs://bucket-test/api/README                      2018-11-16T02:15:49Z          521       standard            "4e9e63a87075df60cdf65c8ce9e92117"
    
    obs://bucket-test/api/except.txt                  2018-11-16T02:15:49Z          20194     standard            "8eb96de3f60447e2f09a7531c99fb3ee"
    
    Next marker: api/except.txt
    Folder number: 1
    File number: 9
  • 示例2:以Windows操作系统为例,运行obsutil ls obs://bucket-test2,查询桶内对象。
    obsutil ls obs://bucket-test2
    Start at 2024-09-30 08:21:06.6300221 +0000 UTC
    
    Listing objects .
    
    Object list:
    key                                               LastModified                  Size      StorageClass        ETag    
    obs://bucket-test2/123                            2022-03-29T09:17:51Z          0B        standard            "d41d8cd98f00b204e9800998ecf8427e"
    
    obs://bucket-test2/1_2-3.txt                      2022-03-29T09:17:51Z          0B        standard            "d41d8cd98f00b204e9800998ecf8427e"
    
    obs://bucket-test2/1_2-3_33.txt                   2022-03-29T09:17:51Z          200B      standard            "dcf204c11d791255adc63e61763c2426"
    
    obs://bucket-test2/新建文本文档.txt
                                                      2022-03-29T09:17:51Z          0B        standard            "d41d8cd98f00b204e9800998ecf8427e"
    
    Total size of bucket: 200B
    Folder number: 0
    File number: 4
  • 示例3:以Windows操作系统为例,运行obsutil ls obs://bucket-test2/prefix,查询桶内以prefix为前缀的对象。
    obsutil ls obs://bucket-test2/prefix
    Start at 2024-09-30 08:24:36.7057148 +0000 UTC
    
    Listing objects .
    
    Object list:
    key                                               LastModified                  Size      StorageClass        ETag    
    obs://bucket-test2/prefix                         2022-03-29T09:17:51Z          0B        standard            "d41d8cd98f00b204e9800998ecf8427e"
    
    obs://bucket-test2/prefix2                        2022-03-29T09:17:51Z          0B        standard            "d41d8cd98f00b204e9800998ecf8427e"
    
    Total size of prefix [prefix]:: 0B
    Folder number: 0
    File number: 2
  • 更多运行示例,请参见列举示例
support.huaweicloud.com/utiltg-obs/obs_11_0014.html