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

Torch Object Storage

Copy page
Download PDF
Common commands
Calculate the size and number of objects and multipart uploads (du)
Copy page
Download PDF
Calculate the size and number of objects and multipart uploads (du)
You can use the du command to calculate the size and number of objects and multipart uploads (including incomplete multipart uploads) under the entire bucket or bucket prefix.​
Notes​
If you need to calculate a large number of objects—potentially in the millions—this command may take longer to execute. We recommend performing the calculation directory by directory if you need to calculate the size and number of objects.​
Command syntax​
​
Linux/macOS
Windows
​
​
​
./tosutil du tos://bucket[/prefix] [-d] [-m] [-v] [-bf=xxx] [-bt=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 calculation.​
prefix​
String​
Sets the prefix to filter objects for calculation.​
-v​
Bool​
Simultaneously calculate the size and number of all latest and historical versions of objects (if any).​
-m​
Bool​
Simultaneously calculate the size and number of all multipart uploads (incomplete multipart uploads).​
-d​
Bool​
Directory mode (using / as a delimiter). Calculate only the objects and subdirectories in the current directory and do not calculate them recursively.​
-bf​
Enum​
The display format for the byte count in the results when calculating the size and number. Possible values:​
  • human-readable​
  • raw​
-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.​
​
Examples​
Calculate all objects​
Use the following command to calculate the number and size of all objects in the bucketname bucket.​
  • Command​
  • ​
    ./tosutil du tos://bucketname ​
    ​
  • Output​
  • The output below shows that there are 53 objects in the bucketname bucket, totaling 2.37 MB. Of those, 45 are stored in Standard Storage, two in Infrequent Access Storage, one in Intelligent Tiering, and five in Cold Archive.​
  • ​
    Start at 2023-11-22 08:39:45.972388 +0000 UTC​
    ​
    Calculating objects .​
    ​
    Storage class Object number Object size​
    ---------------------------------------------------------------------------------------------​
    STANDARD 45 1.90MB​
    IA 2 80.78KB​
    INTELLIGENT_TIERING 1 67.90KB​
    COLD_ARCHIVE 5 323.43KB​
    ---------------------------------------------------------------------------------------------​
    ​
    Total object number: 53 Total object size: 2.37MB​
    ​
    End at 2023-11-22 08:39:46.97474 +0000 UTC, 1002 ms elapsed​
    ​
Calculate latest and historical object versions separately​
Use the following command to calculate the number and size of the latest and historical versions of all objects in the bucketname bucket.​
  • Command​
  • ​
    ./tosutil du tos://bucketname -v​
    ​
  • Output​
  • The output below shows that there are 58 objects in the bucketname bucket, totaling 2.37 MB. Of those, 53 are latest versions and five are historical versions.​
  • ​
    Start at 2023-11-22 08:40:21.750155 +0000 UTC​
    ​
    Calculating versioning objects .​
    ​
    Storage class Object number(all) Object size(all)​
    ---------------------------------------------------------------------------------------------​
    STANDARD 50 1.99MB​
    IA 2 80.78KB​
    INTELLIGENT_TIERING 1 67.90KB​
    COLD_ARCHIVE 5 323.43KB​
    ---------------------------------------------------------------------------------------------​
    ​
    Storage class Object number(latest) Object size(latest)​
    ---------------------------------------------------------------------------------------------​
    STANDARD 45 1.90MB​
    IA 2 80.78KB​
    INTELLIGENT_TIERING 1 67.90KB​
    COLD_ARCHIVE 5 323.43KB​
    ---------------------------------------------------------------------------------------------​
    ​
    Storage class Object number(historical) Object size(historical)​
    ---------------------------------------------------------------------------------------------​
    STANDARD 5 90.59KB​
    IA 0 0B​
    INTELLIGENT_TIERING 0 0B​
    COLD_ARCHIVE 0 0B​
    ---------------------------------------------------------------------------------------------​
    ​
    Total latest object number: 53 Total latest object size: 2.37MB​
    Total historical object number: 5 Total historical object size: 90.59KB​
    Total object number: 58 Total object size: 2.45MB​
    Total delete marker number: 6​
    ​
    End at 2023-11-22 08:40:22.756633 +0000 UTC, 1006 ms elapsed​
    ​
​
Last updated: 2025.12.17 18:33:43