views:

40

answers:

2

Hi, i need to calculate a checksum for a directory in question.

It should return one number for this directory, not for each file inside it.

Can you, quys, help me with it ?

Thanks.

+1  A: 

Check out md5deep. From its homepage:

md5deep is a set of programs to compute MD5, SHA-1, SHA-256, Tiger, or Whirlpool message digests on an arbitrary number of files.

I haven't used it myself, but from what I gather it's pretty much a collection of multi-file versions of md5sum, sha256sum and similar checksum tools from GNU Coreutils.

gspr
+1  A: 

You may be able to use tar to do this. Something like tar -c dir/ | md5sum -b, although you may need to play with the options to tar so it doesn't include access times (which would mess up the checksum if somebody accesses the files in that directory, even without modifying any of them).

Jonathan