Original URL: http://blog.csdn.net/wangjunjun2008/article/details/19840671
Du (disk usage), as the name implies, view the size of the directory/file footprint
#查看当前目录下的所有目录以及子目录的大小
$ 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)
#查看当前目录及其指定深度目录的大小
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 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
DF is used to view the space utilization of the device
$ df-lh
#查看设备使用率
"Go" linux command view file space size-DU,DF