The problem is: I copied a 340 GB folder and I wanted to check if the copy was successful. The copy was made using rsync -aP /origin /dest from one ext4 partition to another ext4 partition.I know that using diff -r /origin /dest to compare the origin and destination directories would take a very (very very) long time. Then I thought I could use rsync -aP --dry-run /origin /dest to compare the directories... And it took 5 seconds(!). (I used time before the command to measure it.)Since rsync -aP showed only the sending incremental file list message, and nothing else (it'd list differing files or files that were not copied), I conclude that it is the fastest and most reliable way to check whether two directories are identical. (As long as rsync -a option was used, files and directories are also identical in terms of owner, permissions and modification time... -P implies --progress.)Am I right? Is rsync -aP --dry-run /origin /dest the fastest and most reliable way to verify whether directories are identical?
Is rsync the fastest and most reliable way to verify whether directories are identical?
rsync;file copy;diff;file comparison