I would like to create a md5 checksum list for all files in a directory.
I want to cat filename | md5sum > ouptput.txt. I want to do this in 1 step for all files in my directory.
Any assistance would be great.
|
I would like to create a md5 checksum list for all files in a directory. I want to Any assistance would be great. |
|||||
|
|
You can pass
If you want to get fancy you can use things like
|
|||||||||||||
|
|
A great checksum creation/verification program is rhash. It creates even SFV compatible files, and checks them too. It supports md4, md5, sha1, sha512, crc32 and many many other. Moreover it can do recursive creation (-r option) like md5deep or sha1deep. Last but not least you can format the output of the checksum file; for example:
outputs a CSV file including the full path of files. I find extremely useful even the -e option rename files by inserting crc32 sum into name. You can change "md5sum" with "rhash" in the PhoenixNL72 examples. |
|||||
|
|
Here are two more extensive examples:
What differs between 1 and 2 is the way the files are presented in the resulting md5 file. The commands do the following:
The output of this entire script can be redirected to a file (.....;done > test.log) or piped to another program (like grep). The output will only tell you which directories where skipped and which have been processed. After a successful run, you will end up with an @md5Sum.md5 file in each subdirectory of your current directory I named the file @md5Sum.md5 so it'll get listed at the top of the directory in a samba share. Verifying all @md5Sum.md5 files can be done by the next commands:
Afterwards you can grep the checklog.txt using grep -v OK to get a list of all files that differ. To regenerate an @md5Sum.md5 in a specific directory, when you changed or added files for instance, either delete the @md5Sum.md5 file or rename it and run the generate command again. |
|||||
|