unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (SunOS-4.1.3)
Page:
Section:
Apropos / Subsearch:
optional field

CMP(1)                      General Commands Manual                     CMP(1)



NAME
       cmp - perform a byte-by-byte comparison of two files

SYNOPSIS
       cmp [ -ls ] filename1 filename2 [ skip1 ] [ skip2 ]

DESCRIPTION
       cmp  compares  filename1 and filename2.  If filename1 is `-', the stan-
       dard input is used.  With no options, cmp makes no comment if the files
       are  the  same;  if they differ, it reports the byte and line number at
       which the difference occurred, or, that one file is an  initial  subse-
       quence  of  the  other.   skip1 and skip2 are initial byte offsets into
       filename1 and filename2 respectively, and may be either octal or  deci-
       mal; a leading 0 denotes octal.

OPTIONS
       -l     Print  the  byte number (in decimal) and the differing bytes (in
              octal) for all differences between the two files.

       -s     Silent. Print nothing for differing files; set exit codes only.

SEE ALSO
       comm(1), diff(1)

DIAGNOSTICS
       Exit code 0 is returned for identical files, 1 for different files, and
       2 for an inaccessible or missing argument, or a system error.



                               23 November 1987                         CMP(1)