df vs du

It is easy to get confused by the df and du output, both can report very different numbers for the disk usage, especially on an older machine and if you have a lot of small files.

Your hard disk is divided into blocks of a certain size, when a file does not fill out a block completely the block will still be unavailable for other files.

The du command shows the file size, ignoring the blocks. The df command considers the blocks and shows the actual disk space used in the filesystem. So the df output is what counts if you are struggling with disk space problems.

df vs du
Share this