[CLUG-tech] tar to md5sum

Jonathan Hitchcock jonathanh at adept.co.za
Mon Mar 12 14:57:37 SAST 2007


Hans van der Merwe wrote:
> Great, I only need yes/no answer,
> but how do I include the contents of the files.

find DIR -printf "%s %p\n" \! -type d -exec md5sum {} \; | md5sum

This prints out the size and pathname, and then, if it's not a directory
being considered, runs an md5sum on it.  Then the whole lot is piped to
md5sum to generate one large md5 hash.


One thing that needs consideration is that the size of a directory may
be different on different filesystems, or differently sized filesystems
(i.e. with a different, erm, is it blocksize?), and this may cause
differences to be reported when there aren't any.  Can anybody confirm
what the 'size' of a directory means, according to find?



More information about the clug-tech mailing list