Linux CMP Command

cmp linux command compares two files and tells you which line numbers are different in linux os.

Syntax

$cmp [option] [file_name1] [file_name2]

Opetions

Sr.No

Options

Descriptions

01

-c

output differing bytes as characters.

02

-l

print the byte number(decimal) and the differing byte values(octal) for each difference.

03

-s

prints nothing for differing files,return exit status only

Returning Values

Sr.No

Options

Descriptions

01

0

file are identical

02

1

file differ

03

2

inaccessible or missing argument

Example


$cmp file1.txt file2.txt
						
Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit