The Linux Newbie Guide  ⇒    Fundamentals     Advanced     Supplement   Command Index   ENG⇒中
All rights reserved, please indicate the source when citing
 





The du command in Linux is used to estimate and display the disk space used by files and directories. The name du stands for "disk usage." It is a handy utility to check how much space different files and directories are occupying on your storage devices. The basic syntax of the du command is:
du [OPTIONS] [FILES/DIRECTORIES] .


Here, "OPTIONS" are optional flags that modify the behavior of the du command, and "FILES/DIRECTORIES" are the names of the files or directories you want to analyze. If you don't specify any files or directories, the du command will display disk usage for the current directory.

Some common options for the du command include:

Here are a few examples of using the du command:
du -h ←Display disk usage of the current directory in human-readable format
du -s /path/to/directory ←Display disk usage of the current directory in human-readable format
du -h -d 2 /path/to/directory ←Display disk usage of files and directories within a specified depth level
du -c -h /path/to/directory1 /path/to/directory2 ←Display total disk usage with a grand total at the end

The du command is useful for monitoring disk space usage, identifying space-consuming files and directories, and managing storage resources efficiently.

For more information on du operations and examples, please refer to the provided link.