I need to calculate a summary md5 checksum for all files of a particular type (*.py
for example) placed under a directory and all sub-directories.
What is the best way to do that?
Edit: The proposed solutions are very nice, but this is not exactly what I need. I'm looking for a solution to get a single summary checksum which will uniquely identify the directory as a whole - including content of all its sub-directories.
Create a tar archive file on the fly and pipe that to md5sum
:
tar c dir | md5sum
This produces a single md5sum that should be unique to your file and sub-directory setup. No files are created on disk.