diff command will tell you the diferences bet files. Redirect the o/p to third file.
$ diff file1 file2 > file3.
Otherwise you can fine tune it with the exit status. exit status of 0 means no differences were found, 1 means some differences were found, and 2 means trouble.
Fedora Development