diff

Format:

diff options file1 file2

Options:

-c Produce a different output from the standard format (see below)
-I Ignore character cases

Using the files file1 and file2 from our comm example, diff will output lines that are different between two files.

					$ diff file1 file2 
2,3c2,3 
< The game 
< Boys in company C 
---
> The games 
> The boys in company C
				

Diff has reported that lines 2 and 3 are different, with the second column in line 3 not matching.

Get Linux and Unix Shell Programming 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.