I used rsync to sync from one machine to another machine(So I think it should be the same folder containing same set of files--and it does contain only files)
when I do du -sh
on the original machine, it produces:
4.0M .
But on my computer, it produces:
3.5M .
When I do ls -lh
in the folder on both machines, the results are the same for each file.
I asked somebody, they told me to use du -bc
, this time the results are the same now.
The original server is running "SUSE Linux Enterprise Server 11 SP2" and my computer is running Ubuntu 12.04.
So it seems there is some difference in implementation of du -sh
? Or why it is different for the same set of files?
du counts disk usage, not file size.
Differences in how the filesystem allocate storages for the file may cause disk usage to differ for the same set of files.
Some possible reasons why disk usage may differ, this is not exhaustive list: