You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Common commands
List resources under an account (ls)
Copy page
Download PDF
List resources under an account (ls)
You can use the ls command to list the resources under your account, such as buckets, objects, and in-progress multipart uploads.​
Listing buckets​
Command syntax​
​
Linux/macOS
Windows
​
​
​
./tosutil ls [-s] [-limit=1] [-e=xxx] [-re=xxx] [-i=xxx] [-k=xxx] [-t=xxx] [-conf=xxx]​
​
​
​
Parameters​
For descriptions of common optional parameters, see Global options.​
​
Parameter​
Type​
Description​
-s​
Bool​
Display results in a compact format. Only bucket names will be displayed.​
-limit​
Integer​
Sets the maximum number of returned resources, with a default value of 1,000.​
​
Examples​
List all buckets​
  • Command​
  • ​
    ./tosutil ls​
    ​
  • Output​
  • ​
    Start at 2022-10-27 09:29:45.79638 +0000 UTC​
    Bucket CreationDate Location ​
    tos://db-storage 2022-07-28T06:53:37Z cn-beijing ​
    ​
    tos://tosutil 2022-07-05T09:40:35Z cn-beijing ​
    ​
    Bucket number is: 2​
    ​
List all buckets in a compact format​
  • Command​
  • ​
    ./tosutil ls -s​
    ​
  • Output​
  • ​
    Start at 2022-10-27 09:29:45.79638 +0000 UTC​
    tos://db-storage​
    tos://tosutil​
    Bucket number is: 2​
    ​
Listing objects or object versions​
Command syntax​
​
Linux/macOS
Windows
​
​
​
./tosutil ls tos://bucket[/prefix] [-s] [-d] [-v] [-marker=xxx] [-versionIdMarker=xxx] [-bf=xxx] [-limit=1] [-bt=xxx] [-et=xxx] [-e=xxx] [-re=xxx] [-i=xxx] [-k=xxx] [-t=xxx] [-conf=xxx]​
​
​
​
Parameters​
For descriptions of common optional parameters, see Global options.​
​
Parameter​
Type​
Description​
bucket​
String​
The name of the bucket for listing.​
prefix​
String​
Sets the prefix to filter objects for listing.​
-s​
Bool​
Display results in a compact format.​
-d​
Bool​
List only the objects and subdirectories in the current directory and do not list them recursively.​
-v​
Bool​
List the versions of the objects in the bucket. If there are historical versions of the objects, the results will include the latest versions and the historical versions.​
-marker​
String​
Sets the starting position for listing the objects in the bucket. The results will include all objects that come after this parameter in a lexicographical sort by name.​
-versionIdMarker​
String​
Sets the starting position for listing the object versions in the bucket. This parameter must be used in conjunction with the -marker parameter.​
The results will include all objects that come after this parameter in a lexicographical sort by object name and version ID.​
-bf​
Enum​
The display format for the byte count in the results when listing objects. Possible values:​
  • human-readable​
  • raw​
-limit​
Integer​
Sets the maximum number of returned resources, with a default value of 1,000.​
-bt​
String​
The type of the bucket. The options are as follows:​
  • fns: A flat namespace (FNS) bucket.​
  • hns: A hierarchical namespace (HNS) bucket.​
If the bucket type is not specified, the default will be the type obtained from the bucket metadata.​
-et​
Enum​
The encoding type for the object names returned. Currently, only url is supported.​
​
Examples​
List the first 1,000 objects in a bucket​
Use the following command to list all objects in the bucketname bucket.​
  • Command​
  • ​
    ./tosutil ls tos://bucketname​
    ​
  • Output​
  • ​
    Start at 2022-10-27 09:39:39.710781 +0000 UTC​
    ​
    Listing objects .​
    ​
    Folder list:​
    tos://bucketname/file/​
    ​
    Object list:​
    key LastModified Size StorageClass ETag ​
    tos://bucketname/file/file1.png 2022-10-27T09:38:41Z 55.98KB STANDARD "d411110de34d37ce8ca0ad0e4dd3****"​
    ​
    tos://bucketname/file/file2.png 2022-10-27T09:38:56Z 74.96KB STANDARD "0216c42adc88aadf0078dd6e4139****"​
    ​
    tos://bucketname/file/file3.png 2022-10-27T09:39:05Z 499B STANDARD "8a5f4cb1a4d760e32f9ee51482c3****"​
    ​
    tos://bucketname/object1.png 2022-10-27T09:37:08Z 55.98KB STANDARD "d411110de34d37ce8ca0ad0e4dd3****"​
    ​
    tos://bucketname/object2.png 2022-10-27T09:37:15Z 56.76KB STANDARD "0eaa38cb4273c20a8ec8a6345aeb****"​
    ​
    tos://bucketname/object3.png 2022-10-27T09:37:21Z 74.96KB STANDARD "0216c42adc88aadf0078dd6e4139****"​
    ​
    Total size of bucket is: 319.14KB​
    Folder number is: 1​
    File number is: 6​
    ​
List all versions of a specified object​
Use the following command to list all versions of the object1.png object in the bucketname bucket.​
  • Command​
  • ​
    ./tosutil ls -s tos://bucketname/object1.png -v​
    ​
  • Output​
  • ​
    Start at 2022-10-27 09:40:42.574241 +0000 UTC​
    ​
    Listing versioning objects .​
    ​
    Folder list:​
    tos://bucketname/file/​
    ​
    Versioning Object list:​
    tos://bucketname/file/file1.png​
    tos://bucketname/file/file2.png​
    tos://bucketname/file/file3.png​
    tos://bucketname/object1.png​
    tos://bucketname/object2.png​
    tos://bucketname/object3.png​
    tos://bucketname/screenshot-20220521-154619.png​
    tos://bucketname/screenshot-20220521-154719.png​
    tos://bucketname/screenshot-20220608-152001.png​
    ​
    DeleteMarker list:​
    tos://bucketname/screenshot-20220521-154619.png​
    tos://bucketname/screenshot-20220521-154719.png​
    tos://bucketname/screenshot-20220608-152001.png​
    ​
    Total size of prefix [object1.png] is: 506.84KB​
    Folder number is: 1​
    Versioning file number is: 9​
    DeleteMarker number is: 3​
    ​
List objects in a folder​
Use the following command to list objects in the file folder within the bucketname bucket.​
  • Command​
  • ​
    ./tosutil ls -s tos://bucketname/file​
    ​
  • Output​
  • ​
    Start at 2022-10-27 09:42:54.896663 +0000 UTC​
    ​
    Listing objects .​
    ​
    Folder list:​
    tos://bucketname/file/​
    ​
    Object list:​
    tos://bucketname/file/file1.png​
    tos://bucketname/file/file2.png​
    tos://bucketname/file/file3.png​
    ​
    Total size of prefix [file] is: 131.43KB​
    Folder number is: 1​
    File number is: 3​
    ​
Listing in-progress multipart uploads​
Command syntax​
​
Linux/macOS
Windows
​
​
​
./tosutil ls tos://bucket[/prefix] [-s] [-d] -m [-uploadIdMarker=xxx] [-marker=xxx] [-limit=1] [-et=xxx] [-e=xxx] [-re=xxx] [-i=xxx] [-k=xxx] [-t=xxx] [-conf=xxx]​
​
​
​
Parameters​
For descriptions of common optional parameters, see Global options.​
​
Parameter​
Type​
Description​
bucket​
String​
Sets the name of the bucket for listing.​
prefix​
String​
Sets the prefix to filter objects for listing.​
-s​
Bool​
Display results in a compact format.​
-d​
Bool​
List only the objects and subdirectories in the current directory and do not list them recursively.​
-uploadIdMarker​
String​
Sets the starting position for listing in-progress multipart uploads within the bucket. This parameter must be used in conjunction with the -marker parameter.​
The results will include all tasks that come after this parameter in a lexicographical sort by object name and upload ID.​
-limit​
Integer​
Sets the maximum number of returned resources, with a default value of 1,000.​
-et​
Enum​
The encoding type for the object names returned. Currently, only url is supported.​
-m​
Bool​
List in-progress multipart uploads for the bucket.​
​
Example​
Use the following command to query the in-progress multipart uploads for the bucketname bucket.​
  • Command​
​
./tosutil ls tos://bucketname -m​
​
  • Output​
​
Start at 2022-10-27 10:01:16.253119 +0000 UTC​
​
Listing multipart uploads .​
​
Upload list:​
Key Initiated StorageClass UploadId ​
tos://bucketname/Visual Studio Code.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework​
2022-10-27T10:00:11Z STANDARD 6b229265e5bcef1437b2485a56ab****​
​
tos://bucketname/installation package/Postman-osx-8.12.4-x64.zip​
2022-10-27T10:01:08Z STANDARD 6b22926509948cb9e10f485a56e4****​
​
tos://bucketname/installation package/VSCode-darwin-universal (1).zip​
2022-10-27T10:01:08Z STANDARD 6b229265c48609aa37b2485a56e4****​
​
tos://bucketname/installation package/draw.io-universal-16.5.1.dmg​
2022-10-27T10:01:08Z STANDARD 6b2292654a1ce26510f94a5a56e4****​
​
tos://bucketname/installation package/go1.17.5.darwin-amd64 (1).pkg​
2022-10-27T10:01:08Z STANDARD 6b2292656a550d73e10f485a56e4****​
​
tos://bucketname/installation package/node-v14.18.1.pkg​
2022-10-27T10:01:09Z STANDARD 6b229265ddf1d388e10f485a56e5****​
​
tos://bucketname/installation package/unconfirmed 442045.crdownload​
2022-10-27T10:01:09Z STANDARD 6b229265b3475a44e10f485a56e5****​
​
tos://bucketname/installation package/unconfirmed 610983.crdownload​
2022-10-27T10:01:12Z STANDARD 6b2292655bccfae610f94a5a56e8****​
​
Folder number is: 0​
Upload number is: 8​
​
​
Last updated: 2025.12.17 18:33:43