Computer Hope

Other Pages

Home
Site map
Computer help

Dictionary
News
Q&A
What's new

Tools

E-mail this page
Print Preview
Edit this page



 

Linux / Unix cmp command

Quick links

About cmp
Syntax
Examples
Related commands
Linux / Unix main page

About cmp

Compares two files and tells you which line numbers are different.

Syntax

cmp [-c] [-i N] [-l] [-s] [-v] firstfile secondfile

-cOutput differing bytes as characters.
-i NIgnore differences in the first N bytes of input.
-lWrite the byte number (decimal) and the differing bytes (octal) for each difference.
-sWrite nothing for differing files; return exit statuses only.
-vOutput version info.
firstfileFirst file that you wish to compare.
secondfileSecond file that you wish to compare to.

Examples

cmp file1.txt file2.txt - Compares file1 to file2 and outputs results. Below is example of how these results may look.

file.txt file2.txt differ: char 1011, line 112

Related commands

comm
diff

Index

Category:
Linux / Unix

Companies:
Click here

Related Pages:

Resolved

Were you able to locate the answer to your questions?

Home - Computer help - Contact - Dictionary - Links
Link to Computer Hope - Bookmark Computer Hope