Linux Server and Workstation Configuration How To

  • Decrease font size
  • Default font size
  • Increase font size
  • default color
  • red color
  • green color
cmp PDF Print E-mail
Friday, 04 December 2009 17:51
AddThis Social Bookmark Button

command cmp

cmp command performs byte comparison of two files.

Syntax

cmp [options] file1 file2

Options

-l displays the byte number (decimal) and the differing bytes (octal) for each mismatch.
-s only returns the exit code (0 - identical files, 1 - various files, 2 -- inaccessible or missing argument).

Description

Command cmp compares file1 and file2. If file1 is replaced by '-' is used standard input. By default, cmp does not issue any messages if the files coincide if the files differ, prominent position in the line and the line number in which is the first mismatched byte. If one of the files is the beginning of another, then message:

cmp: EOF on_the_file_name_shorter
 

Add comment


Security code
Refresh

Useful Links

Follow us on ...

  • Digg: hgevs
  • Facebook Page: 180986722511
  • Linked In Group: 2571120
  • Ning: linuxconfignet
  • Twitter: linuxconfignet

Friends

Thanks David Ayvazyan for provided useful information and discussions.
www.gnu.am (Armenian Translation)