diff — Display Line-by-Line Differences Between Pairs of Text Files

Synopsis

/usr/bin/diff [-bitw][-c | -e | -f | -h | -n] file1 file2 
/usr/bin/diff [-bitw][-C number] file1 file2 
/usr/bin/diff [-bitw][-D string] file1 file2 
/usr/bin/diff [-bitw][-c | -e | -f | -h | -n][-l][-r][-s] 
  [-S name] file1 file2
					

Description

The diff command compares the contents of file1 and file2 line by line and produces a complete index of all of the lines that differ between the two files, along with their line numbers. It also reports what must be changed to make the files match. No output is produced if the files are identical.

The following example illustrates the diff output for two simple files.

castle% diff kookaburra1 kookaburra2 4c4 < Gay your life must ...

Get Solaris™ 7 Reference 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.