How to use diff in UNIX
The following were taken from http://www.unixtutorial.org/2008/02/compare-text-files-using-diff/. All credits goes to them. If you need to compare two text files in Unix, you're mostly likely to use the diff command. Today I'll talk about the simplest scenario: you want to compare two files and understand if there are any differences. Suppose you have two files in /tmp directory: /tmp/1.txt: aaa bbb ccc ddd eee fff ggg and /tmp/2.txt: bbb c c ddd eee fff ggg hhh I have deliberately created them so short and simple - this way it's easier to explain how the comparison works. If there are no differences between the files, you will see no output, but if two text files are indeed different, all the text mismatches will be highlighted using the standard diff output: $ diff /tmp/1.txt /tmp/2.txt 1d0 c c 7a7 > hhh Lines like "1d0" and "3c2" are the coordinates and types of the differences between the two compared files, while lines like " " and ...