Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/cmp/cmp.1
Show All 34 Lines | |||||
.Dt CMP 1 | .Dt CMP 1 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm cmp | .Nm cmp | ||||
.Nd compare two files | .Nd compare two files | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Nm | .Nm | ||||
.Op Fl l | s | x | .Op Fl l | s | x | ||||
.Op Fl hz | .Op Fl bhz | ||||
.Op Fl -ignore-initial Ns Cm = Ns Ar num1 Ns Op :num2 | .Op Fl -ignore-initial Ns Cm = Ns Ar num1 Ns Op :num2 | ||||
.Op Fl -bytes Ns Cm = Ns Ar num | .Op Fl -bytes Ns Cm = Ns Ar num | ||||
.Ar file1 file2 | .Ar file1 file2 | ||||
.Op Ar skip1 Op Ar skip2 | .Op Ar skip1 Op Ar skip2 | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Nm | .Nm | ||||
utility compares two files of any type and writes the results | utility compares two files of any type and writes the results | ||||
to the standard output. | to the standard output. | ||||
By default, | By default, | ||||
.Nm | .Nm | ||||
is silent if the files are the same; if they differ, the byte | is silent if the files are the same; if they differ, the byte | ||||
and line number at which the first difference occurred is reported. | and line number at which the first difference occurred is reported. | ||||
.Pp | .Pp | ||||
Bytes and lines are numbered beginning with one. | Bytes and lines are numbered beginning with one. | ||||
.Pp | .Pp | ||||
The following options are available: | The following options are available: | ||||
.Bl -tag -width indent | .Bl -tag -width indent | ||||
.It Fl b , Fl -print-bytes | |||||
Print each byte when a difference is found. | |||||
.It Fl h | .It Fl h | ||||
Do not follow symbolic links. | Do not follow symbolic links. | ||||
.It Fl i Ar num1 Ns Oo :num2 Oc , Fl -ignore-initial= Ns Ar num1 Ns Op :num2 | .It Fl i Ar num1 Ns Oo :num2 Oc , Fl -ignore-initial= Ns Ar num1 Ns Op :num2 | ||||
Skip | Skip | ||||
.Ar num1 | .Ar num1 | ||||
bytes from | bytes from | ||||
.Ar file1 , | .Ar file1 , | ||||
and optionally skip | and optionally skip | ||||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | |||||
.Xr diff3 1 | .Xr diff3 1 | ||||
.Sh STANDARDS | .Sh STANDARDS | ||||
The | The | ||||
.Nm | .Nm | ||||
utility is expected to be | utility is expected to be | ||||
.St -p1003.2 | .St -p1003.2 | ||||
compatible. | compatible. | ||||
The | The | ||||
.Fl b , | |||||
.Fl h , | .Fl h , | ||||
.Fl i , | .Fl i , | ||||
.Fl n , | .Fl n , | ||||
.Fl x , | .Fl x , | ||||
and | and | ||||
.Fl z | .Fl z | ||||
options are extensions to the standard. | options are extensions to the standard. | ||||
.Ar skip1 | .Ar skip1 | ||||
Show All 13 Lines |