Each os version :windows7 and Red Hat Enterprise Linux Server release 6.5 (Santiago).

I copied files and directories(about 50GB) to linux from windows.

It took hours and now I need to make sure there's no missing files by comparing size.

But it seems each OS calculates folder size different.

For example, there is a folder contains a file sized 5770 byte.

And this folder size is 5770 byte in Window, but 9866 byte in Linux.

How can I exactly compare them??


ls -FaGl /mydir/*/ result :

total 240
drwxrwxr-x  5 webmaster  4096 Oct 20 11:39 ./
drwxr-xr-x 12 webmaster  4096 Oct 20 15:53 ../ /
-rw-rw-r--  1 webmaster  6662 Oct 20 11:39 mydata1.dat
-rw-rw-r--  1 webmaster  6662 Oct 20 11:39 mydata2.dat

total 24
drwxrwxr-x  5 webmaster  4096 Oct 20 11:39 ./
drwxr-xr-x 12 webmaster  4096 Oct 20 15:53 ../ /
-rw-rw-r--  1 webmaster  6662 Oct 20 11:39 mydata3.dat
-rw-rw-r--  1 webmaster  6662 Oct 20 11:39 mydata4.dat

don't get what total means.. some subdirectories have `total' some others don't.

  • Did you use a command to check the file sizes or through the GUI? – Leathe Oct 21 '15 at 7:14
  • @Leathe a command line – Deckard Oct 21 '15 at 7:19
  • Did you use, for example, ls -FaGl or du in linux and dir in Windows? The du command only shows disk usage, not actual file size. Are these size on disk sizes or actual file sizes? Also, what filesystems are you using on the OS'es? – Leathe Oct 21 '15 at 7:24
  • @Leathe In windows, just use property by clicking right-button. In linux du -shb /mydir/*/ – Deckard Oct 21 '15 at 7:38
  • try it with ls -FaGl /mydir/*/ – Leathe Oct 21 '15 at 7:59

Calculate the difference:

9866 - 5770 = 4096 or 4KB

In Linux, each folder is in fact a file. And this file is (minimal) 4096 bytes. It has information about the files in that folder in text format. You can open it in Vim or Nano and see what it is. If the folder has many files and subfolders, it's bigger than 4KB.

Open the folder file in vim (without ending /):

vim /mydir 

To compare sizes, you need to exclude folders from the equation.

If you have problems uploading all data, you could create a local Centos VM in Virtualbox with the same filesystem, upload to that using the same FTP client, and then compare the results on Centos with those on Redhat.


If you used a system call to copy files there will be no missing files.

You cannot as you have found out use size to make sure nothing is missing.

Use a piece of software that compares based on the content of files. Such as WinMerge (thought this is windows only)

  • Because the size is too big, accidentally stopped, and I re-upload via FTP(not filezilla. Very poor featured FTP. but I have to use this). And there's very big files. I worry about that file transferred perfectly – Deckard Oct 21 '15 at 8:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.