posted on 09:27 AM on Wednesday 06 March 2024

Found a super useful program hashdeep (https://github.com/jessek/hashdeep) to compute the hashes for files in a recursive fashion. The program hashdeep goes one step further to compare the files which is quite useful. But the output is rather messy and difficult to work with.

The following is the command to generate the md5 and sha256 for all files in a directory recursively.

hashdeep -r -l EXAMPLE_DIR > EXAMPLE_DIR.hashdeep

Note the use of -r for recursive and -l for relative paths.

If there is another copy of the directory, this can be compared as such:

hashdeep -a -vv -r -l -k EXAMPLE_DIR.hashdeep EXAMPLE_DIR

Note the use of the -a for audit mode, -k for the input hashes computed previously and -vv for detailed outputs.

I might write a wrapper script for this as I typically have to compare versions of a directory between server and local.