4

When I use df -h it gives following result for /appl directory

/appl                   39G    32G   6.7G    83%    /appl

But when I enter that directory cd /appl and run du -sh it is giving me the following result :

 4.9G   .

If the /appl mountpoint is occupied 32GB why is it showing that it's directories total to 4.9G?

4

1 回答 1

3

首先dfdu是两个完全不同的 Linux 实用程序。

df = Disk free
du = Disk usage

df有关 df 的更多信息)将读取包含指定文件夹的文件夹,在您的情况下meta data,它会返回而不是实际目录的文件夹。disk partitionapp1disk partition information

但是du有关 du 的更多信息)将遍历指定的目录树并计算目录下所有文件的总大小并返回total space occupied by that directory.

接下来回答你的问题:
cd /appl或者cd <mount_point>是不可能的。
要检查分区app1安装使用mount命令的位置。

您看到的混乱是因为必须有一个名为app1under /directory 的文件夹,还有一个名为app1.

一旦你找到mount pointapp1 分区cd的那个目录,然后运行du -sh预期的输出,应该会32G花费一些时间。

注意:app1分区挂载点和/app1不一样。

于 2015-06-11T05:51:24.080 回答