Linux Essays (8)---df and du

Source: Internet
Author: User
Tags disk usage

first, the purposeThis article describes the use of the Disk Management tool df and Du.
The DF tool is used to view the disk usage of each partition in the system, and the Du tool is used to view the size of each directory in the file system. For example, DF is equivalent to the disk usage features shown in the Windows system, such as C, D, and so on, and du corresponds to the size of each directory displayed under each drive letter in the Windows system.
This article will select the ubuntu14.04 release as the basis for the description.

Second, DF commandThe DF command can view disk usage information and index node usage information for each partition in the system.

Syntax: DF [Options] [file]
Options
-H: Displays the result with a good reading suffix such as MB or GB.
-I: Displays the utilization of the index nodes.

The commonly used DF command is given below:
1. list disk usage per partition of the system
Usage: df-h

2. List the utilization rate of each partition index node of the system
Usage: df-i

3. Show which partition the current directory is in
Usage : DF.

Iii. ExamplesAs can be seen,/DEV/SDA1 partition total 94G size, has used 4.8G, the remaining 85G;/DEV/SDA3 partition 132G size, has used 520M, the remaining 125G.
Use the DF command to quickly see the current directory in the/DEV/SDA1 partition.



iv. du commandThe     du command is used to display the disk usage per directory, which is the size of each directory.

    syntax: du [options] [directories]
    options:
   - A: Lists the disk usage for all files, including the directory.
   -C: Lists the statistical values for all items.
   -H: Add a good reading suffix such as MB or GB to the results.
   -S: Displays the disk usage of the directory and does not recursively display the disk usage for each subdirectory.
   -S: Displays only the size of the directory itself, excluding the size of its subdirectories.

    The common to du command is given below:
    1, displays the size of all directories under a path
    usage: du-chs/home/zsy/*

Span style= "White-space:pre" >     2, showing the size of all directories under a path
    Usage: du-chss/home/zsy/*

v. Examplesas you can see, Du-chs shows that the current directory occupies a total of 461M of disk space, and du-chs./* Displays the size of each subdirectory under the current directory, where the GitHub subdirectory occupies up to 15M disk space; Du-chss./% Displays the size of each subdirectory in the current directory, where the GitHub subdirectory occupies 4K of disk space.



Vi. Summary

This article describes the disk viewing tools commonly used under Linux DF and DU,DF used to view the disk usage of each partition in the system, Du is used to view the size of each directory.


Copyright Notice:

Original works, such as non-commercial reprint, please specify the source, such as commercial reprint publication, please contact the author.

Linux Essays (8)---df and du

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.