Check the md5sum for the whole folder

Sometimes we want to check if the specified svn tag code is the same as the trunk code. It is impossible for us to md5 by zip the whole folder, because after the zip, timestamp will involve in the zip file.
We can use find,grep,md5 together to solve this problem.
Here is the script i use to md5sum the whole folder.

find ./ -type f -name *.java |grep -v .svn|xargs md5  |md5

you should be caution that you should not check the parents folder name, or the md5sum will be differernt.
For example, if you hava tag folder name 20150923, and trunk name trunk. You have to use the script seperately for two folers.

cd trunk
find ./ -type f -name *.java |grep -v .svn|xargs md5  |md5
cd 20150923
find ./ -type f -name *.java |grep -v .svn|xargs md5  |md5

and compare each one.

Print Friendly

jiang yu

Leave a Reply