GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
COMPARE(1L) Schily´s USER COMMANDS COMPARE(1L)

compare - fast binary comparison of two files

compare [ options ] file1 file2

Compare examines one file and standard in, or two files on a byte by byte basis, and prints the file position of the first difference it finds, first in decimal and then in hexadecimal, followed by the differing byte content in hexadecimal and as quoted character.

Compare is similar to the UNIX utility cmp(1) but faster.

The lines count from 1, the byte offset counts from 0. This is a deviation from the UNIX cmp(1) utility, which counts byte offsets beginning from 1.

Note all options can be abbreviated to their first letter.
-all, -a, -long, -l
Do not stop comparing the files if the first difference is found.
-lines,-L
Count lines while comparing data. This slows down the process of comparison by a factor of two. The line count starts after the optional initial skip on a file.
b=#
begin=#
Start comparing at byte n, otherwise at byte 0.
b1=#
begin1=#
Start comparing file 1 at byte n, otherwise at byte 0.
b2=#
begin2=#
Start comparing fle 2 at byte n, otherwise at byte 0.
c=#
count=#
Stops after comparing n bytes, otherwise if the first files encounters EOF.
-silent
Does not print messages, just returns the exit code.
-help
Prints a short summary of the compare options and exists.
-version
Prints the compare version number string and exists.

numbers in the options begin=#, begin1=#, begin2=#, and count=# are assumed to be bytes. However typing the character 'b' after the number means blocks (512 bytes). (E.g. begin=6b count=1000b). Other suffixes may used as for the bs= option in sdd(1) 'k' means 1024 bytes, 'm' means 1024 KBytes.

compare(1) has been initially written by Joerg Schilling in 1985 and is still maintained by Joerg Schilling.

Joerg Schilling
D-13353 Berlin
Germany

Mail bugs and suggestions to:

joerg@schily.net

2020/09/16 Joerg Schilling

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.