View the size of each folder in Linux (Scan disk)

Source: Internet
Author: User
Tags disk usage

DF -H/du -hs./dugrep [[:d igit:]+]g

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 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 every subtree

Du/home/linux

This shows the number of disk blocks in the/home/linux directory and each of its subdirectories.

2> to display the disk usage of a tree and each of its subtrees in 1024-byte units

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 one directory tree and each subtree 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 human form of K, M and G

6> View the size of the user directory under the current directory, and do not want to see other directories and their subdirectories:

Du-sh User

-S means that a summary value is listed only

Du-h--max-depth=0 User

--max-depth=n means that only deep into the nth-level directory, where set to 0, means not to go deep into subdirectories.

7> lists the size of all directories and files under the user directory and its subdirectories:

Du-ah User

-a means including directories and files

8> lists the size of the directory in the current directory that does not include the XYZ string:

Du-h--exclude= ' *xyz* '

9> want to get more information about the user directory and the size of subdirectories on one screen:

du-0h User

0 (bar 0) indicates the information for each directory listed, not wrapping, but outputting the information of the next directory directly.

10> only shows all disk usage for one directory tree

Du-s/home/linux

11> View each folder size: Du-h--max-depth=1

View the size of each folder in Linux (Scan disk)

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.