logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

cmp - compare two files

Description

       The two files are compared.  A diagnostic results if the contents differ, otherwise there is no output.

       The options are:

       l      Print the byte number (decimal) and the differing bytes (hexadecimal) for each difference.

       s      Print nothing for differing files, but set the exit status.

       L      Print the line number of the first differing byte.

       If  offsets  are  given,  comparison  starts  at  the designated byte position of the corresponding file.
       Offsets that begin with 0x are hexadecimal; with 0, octal; with anything else, decimal.

Diagnostics

       If a file is inaccessible or missing, the exit status is If the files are the same, the  exit  status  is
       empty  (true).   If  they  are  the  same  except  that  one is longer than the other, the exit status is
       Otherwise cmp reports the position of the first disagreeing byte and the exit status is

                                                                                                     CMP(1plan9)

Name

       cmp - compare two files

See Also

diff(1)

Source

/src/cmd/cmp.c

Synopsis

cmp [ -lsL ] file1file2 [ offset1 [ offset2 ] ]

See Also