Check if 2 files are identical byte-to-byte?

In my server migration requirement, I need to compare if one file on old server is exactly the same as the corresponding file on the new server.

For diff and comm, the inputs need to be sorted. But I do not want to disturb the content of the file and need to find byte-to-byte match.

Please help.

md5 $file

Why can't you try doing a cksum on both files and compare?

cksum works fine. I tried on test files. Thanks dj.

Just curious to know if there are any more methods.

cmp -l file1 file2