I have a folder(which contains a lot of sub-folders and files) on a machine, I used
du -m
and it shows the disk usage of all sub-folders and files, anyway, the overall disk usage is 78M
I used scp -r to copy the folder into another machine,
this time, du -m get the overall disk usage: 12M,
very different.
Why does this happen?
I'm afraid some of the files or sub-folders are not copied fully, so are there any other ways to check the total number of bytes?
scpcommand line: were you just copying the directory? – Gilles 'SO- stop being evil' May 07 '13 at 01:06scp -r– misteryes May 07 '13 at 08:25find | sort)? If not, what can you spot about the ones that are missing? If you do, do all the files have the same size (compare the output ofdu -ak | sort -k2)? – Gilles 'SO- stop being evil' May 07 '13 at 08:28du -k|wc -l, the number of files/subfolders is the same. But for the same file, the size is different, e.g, for a file on one machine it is 4K withdu -kbut 16 bytes withdu -b, on another machine it is 0K withdu -kand 16 bytes withdu -b– misteryes May 07 '13 at 09:30ufssystem while the small-sized folder is in anfssystem. There are a lot of small files and many sub-folders within sub-folders. 1 to 2 thousand files. – misteryes May 07 '13 at 11:15