cmp(C) 19 June 1992 cmp(C) Name cmp - compare two files Syntax cmp [ -l ] [ -s ] file1 file2 Description cmp compares two files and, if they are different, displays the byte and line number of the differences. If file1 is ``-'', the standard input is used. The options are: -l Prints the byte number (decimal) and the differing bytes (octal) for each difference. -s Returns an exit code only, 0 for identical files, 1 for different files, and 2 for inaccessible or missing files. This command should be used to compare binary files; use diff(C) or diff3(C) to compare text files. See also comm(C), diff(C), diff3(C) Standards conformance cmp is conformant with: AT&T SVID Issue 2; and X/Open Portability Guide, Issue 3, 1989.