# Running 'diff 'command after the 'find' command

I'm running this code on shell

mv -f ~/sites/text1.txt  ~/sites/text2.txt;find ~/sites/ -type f -exec sha1sum {} >> ~/sites/text.txt \;diff ~/sites/text1.txt ~/sites/text2.txt;


However every time I'm having this error:

find: missing argument to -exec'


Please anyone figure out how to get this code work?

• find is expecting a terminator \;. You misplaced it after the redirect >>. You should have something like -exec sha1sum {} \; >> ~/sites/text.txt – alvits Dec 27 '13 at 6:43
• Thanks for figuring out it. Yes this is the problem. – inckka Dec 27 '13 at 7:13

mv -f ~/sites.data/text1.txt  ~/sites.data/text2.txt &&\

• I found the sort command s required hear. Addition to this I'm having another problem, find ~/sites/ -type f -exec sha1sum {} \; |sort> ~/sites.data/text1.txt command takes more than 20 mnts to get completed. I need to diff to be run after that, however currently diff runs instantly without listning to &&` Is there any solution for this? – inckka Dec 28 '13 at 2:14