*nix: Comparing two files

Everybody knows about diff.

I read about sdiff today for side by side diff.

Here is the one I found useful in some cases but I forget it so I am saving it here:

cmp – compare two files

cmp [-l | -s] file1 file2 [skip1 [skip2]]

The cmp utility compares two files of any type and writes the results to
the standard output. By default, cmp is silent if the files are the
same; if they differ, the byte and line number at which the first differ-
ence occurred is reported.

May be I will add some examples to show the difference but later.

One Response
  1. March 2, 2009