Du command-linux command five-minute series three

Source: Internet
Author: User
Tags disk usage

This original article belongs to the "Linux Greenhouse" blog.

The blog address is http://roclinux.cn.

Article author for Roc

I hope you can donate to support the operation and development of the Linux greenhouse blog. See "About Donations"

==

Du command: Disk usage, as the name implies, is about directory usage. Yes, it works by calculating the size of the directory.

1.

To see the size of all directories and subdirectories in 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

2.

Just want to see the size of the ABC directory under the current directory, and don't want to look at other directories and their subdirectories:

# DU-CH ABC | Tail-n 1

This method requires pipeline technology to pipe du and tail two commands to implement.

-C indicates that the sum of the sizes of all listed directories is finally calculated

# DU-SH ABC

-S means that a summary value is listed only

# du-h--max-depth=0 ABC

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

3.

Lists the size of all directories and files under the ABC directory and its subdirectories:

# Du-ah ABC

-a means including directories and files

4.

Lists the size of the directory names in all ABC directories that do not include the XYZ string:

# du-h–exclude= ' *xyz* '

5.

To get more information about the ABC directory and the size of subdirectories on one screen:

# du-0h ABC

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

Du command-linux command five-minute series three

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.