57 lines · 1.0 KB · Text
RawDownload
.TH CMP 1 .SH NAMEcmp \- compare two files.SH SYNOPSIS.B cmp[.B -lLs].I file1 file2[.I offset1[.I offset2]].SH DESCRIPTION.I Cmpcompares the two files and printsa message if the contents differ..PPThe options are:.TP.B -lPrint the byte number (decimal) and thediffering bytes (hexadecimal) for each difference..TP.B -LPrint the line number of the first differing byte..TP.B -sPrint nothing for differing files,but set the exit status..PD.PPIf offsets are given,comparison starts at the designated byte positionof the corresponding file.Offsets that begin with.B 0xare hexadecimal;with.BR 0 ,octal; with anything else, decimal..SH SOURCE.B /sys/src/cmd/cmp.c.SH SEE ALSO.IR diff (1) .SH DIAGNOSTICSIf a file is inaccessible or missing, the exit status is.LR open .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.LR EOF .Otherwise.I cmpreports the position of the first disagreeing byte and the exit status is.LR differ .