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.