How to check md5sum between two directories?

5,445

first get md5sum of directory1 all files and write to a file.

find dir1 -type f -exec md5sum '{}' + >dir1_checksum.txt

Then find all directory2 files checksum and output those checksums didn't match using grep -vf filename.

find dir2 -type f -exec md5sum '{}' + | grep -vf dir1_checksum.txt
Share:
5,445

Related videos on Youtube

Pandya chinna
Author by

Pandya chinna

Updated on September 18, 2022

Comments

  • Pandya chinna
    Pandya chinna over 1 year

    I have two directories. I want to check whether all files in one directory are same as that of other directory or not by using md5sum. If the md5sum results in a difference, I want to apply diff.

    So how to check md5sum and find out whether MD5 values are same or not?