2

How do I create checksum for a directory with md5deep, for checking duplication in another location?

For example:

I want to create checksum file for /home/user/Documents and I want check duplicate in /media/usb/Documents. If I use this:

md5deep -r -s /home/user/Documents > checksum.md5

The checksum file has the absolute path of the directory like:

f110abe5b3cfd324c2e5128eb4733879  /home/user/Documents/Dir01/file01

How do I make a path like Dir01/file01?

muru
  • 197,895
  • 55
  • 485
  • 740
Ivan
  • 769

1 Answers1

4

Try the -l option. From man md5deep:

-l     Enables relative file paths. Instead of  printing  the  absolute
       path for each file, displays the relative file path as indicated
       on the command line. This flag may not be  used  in  conjunction
       with the -b flag.

So do:

cd /home/user/
md5deep -lrs Documents > checksum.md5

For example,

$ md5deep -lrs Downloads | head -1
699cd26d7fe0bada29eb1b2cd7b50e4b  Downloads/Sublime Text 2.0.2 x64.tar.bz2
muru
  • 197,895
  • 55
  • 485
  • 740