Differences between DF and DU commands in Linux systems

Source: Internet
Author: User

Found a user's computer, DF check out/disk space occupied 16G, than with du view to get more disk space, du view/under All program directory add up to less than 5G. What is the reason for this?

Even if there is a hidden file, check it is very small ah. Because DF and du do not have the same statistical mechanism. Du will count all files, directories, and directories under the specified directory. is based on the fact that the file system can see that there are indeed such a number of documents. This means that the files that we can see in the file system will be counted by DU. DF (DF command draws the total number of blocks and remaining blocks by looking at the file system disk block allocation graph. ): This is about the way the program writes a file, a process that writes something to a file, then gets a pointer, and then writes to the file (the disk area) to which the pointer is pointing. If for some reason (or possibly artificially) the file being pointed to has been deleted, but (write call) does not know whether the file is still in, it will continue to write to it, regardless of whether the file exists, disk block or write operation use. Therefore, because the file does not have, so du statistics are not written to these disk blocks, but because the process is still written, disk space is not released, so DF can be counted, so DF statistics is much larger than the results of DU. How to solve it? 1. Stop the program on the system. 2. If it doesn't work, unmount the file system. 3. Rebooting the system

Differences between DF and DU commands in Linux systems

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.