LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   sha1sum a folder and files? (https://www.linuxquestions.org/questions/linux-newbie-8/sha1sum-a-folder-and-files-841944/)

clifford227 11-02-2010 01:31 PM

sha1sum a folder and files?
 
Is there anyway to make a hash (or similar), of a folder of files, for data integrity purposes?

I tried with sha1sum, but it cant do it.

Is it possible with some other software?

neonsignal 11-02-2010 05:17 PM

You can do this with sha1sum, but there are some issues when trying to do this on a group of files.

For example, if you were just doing a bunch of files, you can do something like the following (where the '-' parameter tells sha1sum to use standard input):
Code:

sha1sum * | sha1sum -
That won't recurse into the subdirectories, or include the meta-data in the sum.

Or you could do something like this:
Code:

tar cO --mtime=0 . | sha1sum -
This will recurse, and include the meta-data. However, the checksum will be dependent on the order in which the files are collected, and you will have to perform the command from the same relative location. You might also want to change the tar parameters depending on which metadata should be included or excluded.

saavik 11-02-2010 05:23 PM

http://sourceforge.net/projects/tripwire/

did a good job for me....


All times are GMT -5. The time now is 03:46 PM.