This is the method, which I found on the ubuntu forums. Essentially md5sum is called on each file with 'find -exec' :find -type f -exec md5sum "{}" \;> md5sum.txt

' find ' returns the contents of the directory, ' -type f ' ensures only regular files are returned, I'm not sure what the ' "{}" \;' part is for, finally I added '> md5sum.txt' to send the output to a file.

This call can take a very long time depending on the size of files it is being called on, so I checked up on it by counting the lines in md5sum.txt with the following command: cat md5sum.txt | nl | tail -1 | cut -f 1

What this does is list the entire md5sum.txt file, count each line with 'nl', output only the last line (aka first from the end) with 'tail -1' then return only the first field of that line with 'cut -f 1'

Finally, once md5sum.txt has been generated the files can be checked using the ' -c ' flag:md5sum -c md5sum.txt

Twitter

Twitter Updates

About Me

Will Winder is a software developer. In his four years of study at UNH he took variety of advanced Computer Science courses including Object Oriented Design, Computer Networks, Artificial Intelligence and Compiler Design. He has been working professionally using C, C++ and Java since graduating in 2006. In his free time he continues to expand his skills by involving himself in many projects, some of which can be seen on this blog.