Think before you speak, read before you think.

对比两个文件夹是否相同

by

in
find dirname1 -type f  -exec md5sum {} + | awk '{print $1}' | sort | md5sum
find dirname2 -type f  -exec md5sum {} + | awk '{print $1}' | sort | md5sum

如果值不一样
分别进入两个目录中

for i in `ls`; do echo $i ; find $i -type f  -exec md5sum {} + | awk '{print $1}' | sort | md5sum ; done

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *