Linux Comm Du
# Linux du Command
[ Linux Command Manual](#)
The Linux du (full English name: disk usage) command is used to display the size of a directory or file.
du displays the disk space occupied by the specified directory or file.
### Syntax
du
**Parameter Description**:
* -a or -all Displays the size of individual files in the directory.
* -b or -bytes Displays the directory or file size in bytes.
* -c or --total In addition to displaying the size of individual directories or files, it also displays the total sum of all directories or files.
* -D or --dereference-args Displays the size of the source file of the specified symbolic link.
* -h or --human-readable Uses K, M, G as units to improve the readability of the information.
* -H or --si Same as the -h parameter, but K, M, G are converted using 1000 as the unit.
* -k or --kilobytes Uses 1024 bytes as the unit.
* -l or --count-links Counts hard-linked files repeatedly.
* -L or --dereference Displays the size of the source file of the symbolic link specified in the option.
* -m or --megabytes Uses 1MB as the unit.
* -s or --summarize Displays only the total size of the specified directory or file, without displaying the size of its subdirectories.
* -S or --separate-dirs When displaying the size of individual directories, it does not include the size of their subdirectories.
* -x or --one-file-xystem Processes based on the file system at the start, ignoring directories on different file systems encountered later.
* -X or --exclude-from= Specifies directories or files in .
* --exclude= Ignores the specified directory or file.
* --max-depth= Ignores directories beyond the specified depth.
* --help Displays help.
* --version Displays version information.
### Examples
Display the space occupied by a directory or file:
# du608 ./test6 308 ./test4 4 ./scf/lib 4 ./scf/service/deploy/product 4 ./scf/service/deploy/info 12 ./scf/service/deploy 16 ./scf/service 4 ./scf/doc 4 ./scf/bin 32 ./scf 8 ./test3 1288 .
Displays the size of subdirectories under the current directory and the total size of the current directory. The bottom value 1288 is the total size of the current directory.
Display the space occupied by a specified file
# du log2012.log 300 log2012.log
Display the space occupied by the test directory in a format that is easy to read:
# du -h test608K test/test6 308K test/test4 4.0K test/scf/lib 4.0K test/scf/service/deploy/product 4.0K test/scf/service/deploy/info 12K test/scf/service/deploy 16K test/scf/service 4.0K test/scf/doc 4.0K test/scf/bin 32K test/scf 8.0K test/test3 1.3M test
[ Linux Command Manual](#)
YouTip