Simple Linux Command Line notes: Du

Source: Internet
Author: User
ArticleDirectory
    • Parameters
    • Option
    • Example
    • Tips

Displays information about the directory hierarchy or file disk usage.

Du [Options] [Path-list]

 

Parameters

Without any parametersDuDisplays the disk usage information of the working directory and Its subdirectories,Path-listSpecifies the path name list of the directory or file used by the disk.

 

Option

-A reports the space occupied by all common files and directories. The default unit is kb.

-C shows the total space occupied at the end of the output result.

-H is measured in KB (kilobytes), MB (megabytes), and GB (gigabytes ).

-S only displays the total size of the specified directory or file on the command line, without showing the total size of its subdirectories

 

Example Du
 
$Du4./Dir8./Test20.

Displays the size of the current directory and subdirectory. The last line contains the total space occupied by the current directory and Its subdirectories.

 

Du-S
$Du-S/usr/*292552/usr/bin124/usr/games19544/usr/include1609180/usr/lib52676/usr/local36276/usr/sbin1738496/usr/%105020/usr/src

Displays the size of the specified directory without the subdirectory. Currently, the size of all directories in USR is displayed.

 

Du-SH
 
$Du-Sh/Usr/*286 m/usr/bin124k/usr/games20m/usr/include1.6g/usr/lib52m/usr/local36m/usr/sbin1.7g/usr/0000103m/usr/src

Display the specified directory size in an appropriate unit

 

Du-SHC
$Du-SHC/usr/*286 m/usr/bin124k/usr/games20m/usr/include1.6g/usr/lib52m/usr/local36m/usr/sbin1.7g/usr/0000103m/usr/src3.7g total usage

Specify the directory size in a proper unit and display the total usage at the end.

 

Tips

Du only displays the information and size of the Directory level, but not the size of a single file.

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.