View each folder size in linux command: Du-h--max-depth=1

Source: Internet
Author: User
Tags disk usage

du [-ABCDHHKLMSSX] [-l < Sign connection >][-x < file >][--block-size][--exclude=< directory or file] [--max-depth=< Number of directory layers >][--help][--version][directory or file]Common parameters:- A or-all displays disk usage for each specified file, or displays the respective 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 the disk usage of a directory tree and each of its subtrees in megabytes 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> only shows the full disk usage of one directory tree Du-s/home/linux

View each folder size in linux command: Du-h--max-depth=1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.