**du (disk usage), as the name implies, view the size of the directory/file footprint * *
1. View the size of all directories and subdirectories in the current directory
Du-h
Du-ah
#-h: Using the human form of K, M and G to display
#-a: Displaying directories and files
du-h tmp
Du-ah tmp
size of #只查看当前目录下的tmp目录 (including subdirectories)
2. View the size of the current directory and its specified depth directory
du-h–-max-depth=0
#-–max-depth=n: Drill down to the nth-level directory, set here to 0, which means not to go deep into subdirectories
Some common parameters of the 3.DU command:
-A or-all displays the size of individual files in the directory
- B or-bytes when displaying a directory or file size, in bytes
- C or--total displays the sum of all directories or files in addition to the size of individual directories or files
-D or--dereference-args displays the source file size for the specified symbolic connection
- h or--human-readable to improve readability of the information in k,m,g units
-K or--kilobytes in 1024x768 bytes units
-L or--count-links repeatedly compute hardware-attached files
The source file size of the symbol connection specified in the-L or--dereference display option
-M or--megabytes in 1MB units
- s or--summarize show totals only
- s or--separate-dirs displays the size of individual directories without the size of their subdirectories
-x< File > or--exclude-from=< file >
--exclude=< directory or File > skip the specified directory or file
--max-depth=< the directory layer > exceeds the specified number of layers, it is ignored
On the du command of Linux