Monday 5 November 2012

du vs df commands

A few days ago I learnt the difference between the du and the df commands, so I thought that I would write it here so that I can safely forget about it :)

df - report file system disk space usage
du - estimate file space usage

What does this mean?

Take an example of a 1 KB file on a filesystem with a block size of 1 MB.

du will display that the file had used only 1KB.
df would display that 1 MB had been used. This is because the block is not free anymore.

This can lead to discrepancies in what is reported by both commands. The bigger your block size the more likely it is that there will be big discrepancies.

1 comment:

  1. A very great thanks for you............to share this kind of article It is very helpful and impressive. If you want to know VPS Server hosting. You can choose France VPS Hosting . It provides extensive backup, server, and network protection with unlimited bandwidth network connections.

    ReplyDelete