This entry is part 11 of 19 in the Bash-whacking series

Ever need to check if a directory is exactly the same as another (including file contents)?

find . -type f -exec md5sum {} + | awk '{print $1}' | sort | md5sum

This runs md5sum on the individual md5sum hashes of each file.

And if you need to exclude a directory from the comparison:

find . -type f -exec md5sum {} + | grep -v dirtoexclude | awk '{print $1}' | sort | md5sum