-1

I have two identical folders on different systems (diff shows that they are the same). However, du, du --apparent-size or the Dolphin-size of the folders show different sizes. I think this is related to the block sizes or the way a folder is implemented in the different file systems. However, I would like to compare the sizes of all included files. Is this possible?

Matthiasho
  • 69
  • 5
  • You want to compare the size or the content of the files? Because two files may have the same size but totally different content. – Romeo Ninov Aug 08 '21 at 05:09
  • I want to compare the size. Howerver, I thought that if the content is the same, also the size has to be the same. That is why I am confused about the meaning of the output of du --apparent-size – Matthiasho Sep 15 '21 at 06:15

1 Answers1

0

The simplest way I know to compare files between two computers is to generate hash on first server, move the file with hashes on second server and use it to check.

sha2sum /path/to/files/* >file_with_hashes

then copy this file_with_hashes to second machine and exec

sha2sum -c file_with_hashes
Romeo Ninov
  • 6,538
  • 1
  • 22
  • 31