aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/cmp/cmp.1
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2021-09-23 05:26:52 +0000
committerKyle Evans <kevans@FreeBSD.org>2021-09-29 18:03:34 +0000
commit4e380e8474609875c4cf5277b3755ac29079a8b5 (patch)
treee59459a8471e686af8dfb74c1367a7cd027f77c1 /usr.bin/cmp/cmp.1
parentf6787614fd4db2a9d5e649af0e819852ebd5a19d (diff)
downloadsrc-4e380e8474609875c4cf5277b3755ac29079a8b5.tar.gz
src-4e380e8474609875c4cf5277b3755ac29079a8b5.zip
cmp: add -n, --bytes to limit number of bytes to compare
This is compatible with GNU cmp. Reviewed by: markj Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32072
Diffstat (limited to 'usr.bin/cmp/cmp.1')
-rw-r--r--usr.bin/cmp/cmp.16
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.bin/cmp/cmp.1 b/usr.bin/cmp/cmp.1
index 6980f73e7be5..511e09ac8628 100644
--- a/usr.bin/cmp/cmp.1
+++ b/usr.bin/cmp/cmp.1
@@ -41,6 +41,7 @@
.Nm
.Op Fl l | s | x
.Op Fl hz
+.Op Fl -bytes Ns Cm = Ns Ar num
.Ar file1 file2
.Op Ar skip1 Op Ar skip2
.Sh DESCRIPTION
@@ -62,6 +63,10 @@ Do not follow symbolic links.
.It Fl l , Fl -verbose
Print the byte number (decimal) and the differing
byte values (octal) for each difference.
+.It Fl n Ar num , Fl -bytes= Ns num
+Only compare up to
+.Ar num
+bytes.
.It Fl s , Fl -silent , Fl -quiet
Print nothing for differing files; return exit
status only.
@@ -165,6 +170,7 @@ utility is expected to be
compatible.
The
.Fl h ,
+.Fl n ,
.Fl x ,
and
.Fl z