md5deep examples

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
peter_b
Chatterbox
Posts: 347
Joined: Tue Nov 12, 2013 2:05 am

md5deep examples

Post by peter_b »

Two basic commands for "a default" usage of "md5deep":

1) Create a recursive hashcode manifest:

Code: Select all

$ md5deep -r -e -l . > ~/cam202206.md5deep
  • -r: Recursive. Also go into subfolders.
  • -e: Show "how long it may take" for each file.
  • -l: Output relative file paths (in the manifest).
  • .: Current folder = "."
  • > ~/cam202206.md5deep: Output the calculated hashes (=manifest) into the given filename.
The manifest name is completely arbitrary. I recommend using ".md5deep" as suffix. It's clear(er) then that it's a hashcode manifest. Yet also indicates that it ain't compatible with the good old "md5sum" (and friends) tools, since it has a different layout/information format.


2) Validating files against that generated manifest:

Code: Select all

$ md5deep -m $MANIFEST -r $FILES
Explanation:
  • -m: Enables matching mode. Each matching (=hashcode identical = OK! :D) file's name will be printed.
  • $MANIFEST: put your previously created md5deep-hashcode-manifest filename here.
  • -r: Recursive. Also go into subfolders.
  • $FILES: Filename or file-mask of files to validate.
Example for digital video camera recordings (Panasonic), which creates files/folders like "DCIM/112XDPHH/S110002.MP4":

Code: Select all

$ md5deep -m ~/xxx/cam202206.md5deep -r 112XDPHH/*
It seems that md5deep is able to "find" files in the manifest, as long as their folder/filename is found in the manifest. I haven't tried with duplicate filenames in separate folders though.

Have fun!
Post Reply