I tried to find out how big each directory in my root-directory is. I cd'ed to / and did:
ls | xargs du -sh
the result:
...
1.9M tmp
975M usr
70G var
...
Then I went to /var/www and did:
du -sh
the result:
81G .
I am intrigued: How can a folder inside a 70 GB folder be 81 GB?
After experimenting a bit, i found out that:
du -sh /*/
will result in
...
1.9M tmp
975M usr
70G var
...
whereas du -hd 1 will result in
...
1.9M tmp
975M usr
91G var
...
Two different sizes for the /var directory, but all other directories have no difference in size.
What's the difference between those two variations of the du command?
Any ideas?
du
outputs) butdu
keeps track of inodes it visits, so if there are hardlinks then only the first occurrence will be counted.du -h -s $something
isdu -h -d 0 $something
. With-d 1
I don't see the same items listed. Also, with either option, inode are only taken in account once; several hardlinks don't inflate the reported size.