df -h统计的信息与du -sh不一致的原因(转)
有时候会遇到这样的问题:df -h统计一个目录,显示有约100M可用空间,使用了5G;而用du -sh统计该目录下的文件大小,却发现总共才占用了1G。也就是说,二者统计结果差距巨大。 例如: 1、df -h /tmp/ 结果: Size Used Avail Use% Mounted on3.9G 3.5G 220M 95% /tmp 2、du -sh /tmp/ 结果: 132K /tmp/ 文章来源:http://www.codelast.com/ 结果差异巨大。 引用网上的一段话,原因是这样的: (1)This section gives the technical explanation of why du and df sometimes report different totals of disk space usage. When a program that is running in the background writes to a file while the process is running, the file to which this proces...

