开发者

Calculate checksum for a directory

开发者 https://www.devze.com 2023-01-20 23:20 出处:网络
i need to calculate a checksum for a directory in question. It should return one number for开发者_JAVA百科 this directory, not for each file inside it.

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

It should return one number for开发者_JAVA百科 this directory, not for each file inside it.

Can you, quys, help me with it ?

Thanks.


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.


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消