cmp—compares two files
cmp [ –l ] [ –s ] filename1 filename2
The two files are compared. cmp makes no comment if the files are the same; if they differ, it announces the byte and line numbers at which the first difference occurred.
Example A.13.
cmp file.new file.old
|
Explanation
If the files differ, the character number and the line number are displayed.
Get Linux Shells by Example now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.