I want to share a little script I wrote that check if two directory is identical rather efficiently. First you may need to understand what sha1sum does.
The sha1sum tool
As the name may suggest, sha1sum compute the SHA-1 checksum of a particular file / text string.
1 2 3 4 5 | [jason@madcoda ~]# echo "Hello World" | sha1sum 648a6a6ffffdaa0badb23b8baf90b6168dd16b3a - [jason@madcoda ~]# echo "Hello World" > hello.txt [jason@madcoda ~]# sha1sum hello.txt 648a6a6ffffdaa0badb23b8baf90b6168dd16b3a hello.txt |
You can see from the above example that sha1sum produce a hash of the content,