Can anybody explain the difference in the disk usage of a directory by du and the one calculated by adding up the size of every file?

VJ vj at vijaygill.homelinux.net
Wed Nov 17 11:48:46 UTC 2004


Hi,

    Can anybody explain the difference in the disk usage of a directory by
du and the one calculated by adding up the size of every file?

[root at dxr tmp]# echo "(0 `find /home/vj/ -name \* -printf "+%s "`) / 1024" |
bc
29091

[root at dxr tmp]# du -s /home/vj/
31883   /home/vj/

Thinking du might be using 1000 as 1Kb rather than 1024, following result is

[root at dxr tmp]# echo "(0 `find /home/vj/ -name \* -printf "+%s "`) / 1000" |
bc
29790

Regards from
VJ




More information about the fedora-list mailing list