cmp in Mac OS X

By: Strauss K Emailed: 1696 times Printed: 2196 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

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.


macos Home | All macos Tutorials | Latest macos Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(1)


1. View Comment

I have a mac book dual booting with snow leopard (OSX 10.6.2) and Windows XP.
I was cleaning it up and ran disk utility's verify and repair on the bootcamp drive which contains Windows XP.
Now when I hold the option key at start up it will only boot right to OSX 10.6 and XP is NOT an option.
How do I correct this?


View Tutorial          By: david at 2015-06-27 15:33:07

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Strauss K
cut in Mac OS X
curl in Mac OS X
crontab in Mac OS X
cron in Mac OS X
cp in Mac OS X
continue in Mac OS X
complete in Mac OS X
command in Mac OS X
comm in Mac OS X
cmp in Mac OS X
cksum in Mac OS X
chroot in Mac OS X
chown in Mac OS X
chmod in Mac OS X
chgrp in Mac OS X

More Tutorials in macos
Getting PHP running on Mac OS 10.1
Installing gedit for python programming in Mac OS X
What is Mac OS X?
History of Mac OS X
Major features of Mac OS X
Different Versions of Mac OS X
What is new in Mac OS X Snow Leopard
alias, unalias in Mac OS X
apropos in Mac OS X
awk in Mac OS X
basename in Mac OS X
bash in Mac OS X
bg in Mac OS X
bless in Mac OS X
break in Mac OS X

More Latest News
Most Viewed Articles (in macos )
cmp in Mac OS X
Installing gedit for python programming in Mac OS X
What is Mac OS X?
History of Mac OS X
Major features of Mac OS X
Different Versions of Mac OS X
What is new in Mac OS X Snow Leopard
alias, unalias in Mac OS X
apropos in Mac OS X
awk in Mac OS X
basename in Mac OS X
bash in Mac OS X
bg in Mac OS X
bless in Mac OS X
break in Mac OS X
Most Emailed Articles (in macos)
chroot in Mac OS X
cp in Mac OS X
What is Mac OS X?
builtin in Mac OS X
cal, ncal in Mac OS X
cat in Mac OS X
complete in Mac OS X
continue in Mac OS X
crontab in Mac OS X
Installing gedit for python programming in Mac OS X
History of Mac OS X
Major features of Mac OS X
Different Versions of Mac OS X
What is new in Mac OS X Snow Leopard
awk in Mac OS X