The du
command is used to obtain statistics on each storage class for a bucket or a directory, including the size and number of objects in each storage class.
./coscli du cos://<bucketAlias>[/prefix/] [flag]
Note:
- For more information on
bucketAlias
, see Download and Installation Configuration.- For other common options of this command (such as switching bucket and user account), see Common Options.
ls
includes the following optional parameters:
Parameter Format | Description | Example |
---|---|---|
/prefix/ | Specifies a directory. | cos://bucket1/picture/ |
du
includes the following optional flags:
Flag Abbreviation | Flag Name | Description |
---|---|---|
None | --include | Includes specific objects. |
None | --exclude | Excludes specific objects. |
Note:
--include
supports standard regular expressions. You can use regular expressions to filter objects that meet your requirements.- When using
zsh
, you may need to enclose the pattern string with double quotation marks.
./coscli du cos://bucket1/picture/ --include ".*.mp4"
bucket1
bucket./coscli du cos://bucket1
picture
directory in the bucket1
bucket./coscli du cos://bucket1/picture/
picture
directory in the bucket1
bucket./coscli du cos://bucket1/picture/ --include .*.mp4
picture
directory in the bucket1
bucket./coscli du cos://bucket1/picture/ --exclude .*.md
Was this page helpful?