How do I check md5sum for a directory tree against a list of checksums?
I ran a md5 checksum on a directory tree generating a list of all md5sums for every file in that dir tree. Now I need to check a copy of that directory against the list. In the terminal I'm sitting at ~/bak-dir/ which has the DIR that I'm checking.
The file is formatted like this: Code:
[md5sum string] /DIR/path/to/file.txt Code:
laptop:~/bak-dir/$ ls -a |
According to that error message, it may not be able to read the contents of the folder. This command may do the trick:
Code:
sudo chmod -R a+r DIR/ |
Did that, ran the check again, and got the same thing. So I tried to cd into DIR and run it from in there with the file.md5 in the parent directory:
Code:
:~/bak-dir/DIR/$ md5sum -c ../file.md5 So now what? |
Wait a second, "/DIR"? But the folder is within ~/bak-dir. Try moving the DIR folder to / (the root folder) and try again.
|
Or,
Code:
sed -e 's%/DIR%DIR%' file.md5 | md5sum -c - |
Yeah, that would work too. So, did it work?
|
It worked! And no errors. Thanks SO much for all the help!
|
You're welcome :).
|
All times are GMT -5. The time now is 01:31 AM. |