cmp COMMAND:
cmp linux command compares two files and tells you which line numbers are different.
SYNTAX:
The Syntax is
cmp [options..] file1 file2
OPTIONS:
- c
Output differing bytes as characters.
- l
Print the byte number (decimal) and the differing byte values (octal) for each difference.
- s
Prints nothing for differing files, return exit status only.
EXAMPLE:
Compare two files:
cmp file1 file2
The above cmp command compares file1.php with file2.php and results as follows.
file1.php file2.php differ: byte 35, line 3
Compare two files output differing bytes as characters:
cmp -c file1.php file2.php
The above cmp command compares file1.php with file2.php and results as follows.
file1.php file2.php differ: byte 35, line 3 is 151 i 15
Find LINUX Commands... Hope you enjoy this tutorial. We welcome your Valuable feedbacks or suggestions on this LINUX / UNIX cmd reference. This is a copyright content.