du [-ABCDHHKLMSSX] [-l < Sign connection >][-x < files >][--block-size][--exclude=< directories or files;] [--max-depth=< directory Layer >][--help][--version][directory or file] Common parameters:-A or-all display disk usage for each specified file, or display their own disk usage for each file in the directory. -B or-bytes displays the directory or file size, in bytes. -C or –total displays the sum of all directories or files in addition to the size of the directory or file. -D or –dereference-args displays the source file size for the specified symbolic connection. -H or –human-readable in k,m,g to improve the readability of the information. -H or –si is the same as the-h parameter, but K,m,g is converted to 1000 units instead of 1024. -K or –kilobytes in bytes units. -L or –count-links repeatedly compute the files for the hardware connection. -l< symbol connection > or –dereference< symbol connection > Display option the source file size of the symbol connection specified. -M or –megabytes in 1MB units. -S or –summarize displays only totals, that is, the size of the current directory. -S or –separate-dirs displays the size of each directory without the size of its subdirectories. -X or –one-file-xystem the file system at the beginning of the processing, if any other different file system directories are skipped. -x< file > or –exclude-from=< file > in < file > specify directory or file. –exclude=< directory or File > skip the specified directory or file. –max-depth=< the number of directory layers > directories that exceed the specified number of layers is ignored. Help Display Help. –version Displays version information. 1> to display disk usage for a directory tree and each of its subtrees du/home/linux this displays the number of disk blocks in the/home/linux directory and each of its subdirectories. 2> to display the disk usage of a directory tree and each of its subtrees in 1024-byte du-k/home/linux This shows the number of 1024-byte disk blocks in the/home/linux directory and each of its subdirectories. 3> displays a directory tree and each of its child units in megabytesThe disk usage of the tree du-m/home/linux This shows the number of MB disk blocks in the/home/linux directory and each of its subdirectories. 4> displays the disk usage of a directory tree and each of its subtrees in gigabytes du-g/home/linux This displays the number of GB disk blocks in the/home/linux directory and each of its subdirectories. 5> View the size of all directories and subdirectories under the current directory: Du-h. "." Represents the current directory. can also be replaced by a clear path-H means to display the 6> in the form of K, M, G to see the size of the user directory under the current directory, and not to look at other directories and their subdirectories: Du-sh user-s means to summarize, that is, to list only a summarized value du-h-- Max-depth=0 user--max-depth=n means only deep into the nth-level directory, which is set to 0, meaning that it does not go deep into subdirectories. 7> lists the size of all directories and files under the user directory and its subdirectories: Du-ah user-a represents the size of directories that include directories and files 8> lists directory names in the current directory that do not include XYZ strings: Du-h--exclude= ' *xyz* ' 9> Want more information about the user directory and the subdirectory size on one screen: du-0h user-0 (bar 0) represents information for each directory listed, without wrapping, but directly outputting the information for the next directory. 10> displays all disk usage for only one directory tree du-s/home/linux 11> view each folder size: Du-h--max-depth=1
View each folder size command in Linux du-h--max-depth=1