About Us Documentation

Contact Site Map
 

  

WinPak
Documentation

Go to the previous, next chapter.

Invoking cmp

The cmp command compares two files, and if they differ, tells the first byte and line number where they differ. Its arguments are as follows:

cmp options... from-file [to-file]

The file name - is always the standard input. cmp also uses the standard input if one file name is omitted.

An exit status of 0 means no differences were found, 1 means some differences were found, and 2 means trouble.

Options to cmp

Below is a summary of all of the options that GNU cmp accepts. Most options have two equivalent names, one of which is a single letter preceded by -, and the other of which is a long name preceded by --. Multiple single letter options (unless they take an argument) can be combined into a single command line word: -cl is equivalent to -c -l.

-c Print the differing characters. Display control characters as a ^ followed by a letter of the alphabet and precede characters that have the high bit set with M- (which stands for ``meta'').
--ignore-initial=bytes Ignore any differences in the the first bytes bytes of the input files. Treat files with fewer than bytes bytes as if they are empty.

-l Print the (decimal) offsets and (octal) values of all differing bytes.

--print-chars Print the differing characters. Display control characters as a ^ followed by a letter of the alphabet and precede characters that have the high bit set with M- (which stands for ``meta'').

--quiet -s --silent Do not print anything; only return an exit status indicating whether the files differ.

--verbose Print the (decimal) offsets and (octal) values of all differing bytes.

-v --version Output the version number of cmp.


 

 

Email addresses listed on this site may  NOT be used for unsolicited commercial email.

Ready-to-Run Software, Inc Privacy Statement

Portions (c)Copyright, 1996-2005 by Ready-to-Run Software, Inc
(All rights reserved.)
212 Cedar Cove
Lansing, NY 14882
Phone: 607 533 UNIX (8649)
Fax: 607 533 4002