tencent cloud

Feedback

Obtaining Statistics on Different Types of Objects - du

Last updated: 2022-05-09 14:18:33

    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.

    Command Syntax

    ./coscli du cos://<bucketAlias>[/prefix/] [flag]
    
    Note:

    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"
    

    Examples

    Listing statistics on objects in the bucket1 bucket

    ./coscli du cos://bucket1
    

    Listing statistics on objects in the picture directory in the bucket1 bucket

    ./coscli du cos://bucket1/picture/
    

    Listing statistics on all MP4 objects in the picture directory in the bucket1 bucket

    ./coscli du cos://bucket1/picture/ --include .*.mp4
    

    Listing statistics on all non-MD objects in the picture directory in the bucket1 bucket

    ./coscli du cos://bucket1/picture/ --exclude .*.md
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support