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

まずdf、 とduは 2 つのまったく異なる Linux ユーティリティです。

df = Disk free
du = Disk usage

dfdf の詳細)は、指定されたフォルダーを含む をmeta data読み取り、実際のディレクトリではなくを返します。disk partitionapp1disk partition information

ただし、du( du の詳細) は、指定されたディレクトリ ツリーを実行し、ディレクトリの下にあるすべてのファイルの合計サイズをカウントして、total space occupied by that directory.

次の質問への回答:
cd /applまたはcd <mount_point>できません。
パーティションがapp1マウントされている場所を確認するには、mountコマンドを使用します。

app1混乱するのは、ディレクトリの下にという名前のフォルダと/、 という名前のパーティションが必要だからですapp1

mount pointapp1 パーティションのを見つけたら、cdそのディレクトリに移動してから実行するとdu -sh、予想される出力が表示されるはず32Gです。

注 :app1パーティションのマウント ポイントと/app1は同じではありません。

于 2015-06-11T05:51:24.080 に答える