compare files

How do we compare files?

file1 stores 2 groups of data, agf1 and bgf1, say.
file2 stores 2 groups of data, agf2 and bgf2, likewise.
I amended agf1 and bgf2. After comparing the two files and finding that they are different, how do we merge them?

have you tried teh command comm?

comm -1,2,3 file1 file2

or you can try the diff command.

Thx Optimus, but how do merge the 2 files though?

to merge file1 and file2 into file3

cat file1 file2 > file3