O'Reilly logo

Linux and Unix Shell Programming by David Tansley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required