cmp in Mac OS X
By: Strauss K Printer Friendly Format
Compare
two files.
The cmp utility compares two files of any type and writes the results to the
standard output. By default, cmp is silent if the files are the same; if they
differ, the byte and line number at which the first difference occurred is
reported.
Syntax cmp [option..] file1 [file2 [skip1 [skip2]]] Options -b --print-bytes Print differing bytes. -i SKIP --ignore-initial=SKIP Skip the first SKIP bytes of input. -i SKIP1:SKIP2 --ignore-initial=SKIP1:SKIP2 Skip the first SKIP1 bytes of FILE1 and the first SKIP2 bytes of FILE2. -l --verbose Output byte numbers and values of all differing bytes. -n LIMIT --bytes=LIMIT Compare at most LIMIT bytes. -s --quiet --silent Output nothing; yield exit status only. -v --version Output version info. --help Output help.
Notes
skip1 and skip2 are
the number of bytes to skip in each file. SKIP values may be followed by the
following multiplicative suffixes: kB 1000, K 1024, MB 1,000,000, M 1,048,576,
GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y.
The offset is decimal by default, but may be expressed as a hex or octal value
by preceding it with a leading `0x' or `0'.
info diff will return full examples for both diff and cmp
If a File is - or missing, read from standard input.
cmp exits with one of the following values:
0
The files are identical.
1 The files are different; this includes the case where one file is identical to
the first part of the other. In the latter case, if the -s option has not been
specified, cmp writes to standard output that EOF was reached in the shorter
file (before any differences were found).
>1 An error occurred.
Most Viewed Articles (in macos ) |
Latest Articles (in macos) |
Comment on this tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Subscribe to Tutorials
Related Tutorials
Archived Comments
1. I have a mac book dual booting with snow leopard (
View Tutorial By: david at 2015-06-27 15:33:07
2. Brettkip
View Tutorial By: Brettkip at 2017-07-27 12:36:30