diff − compute `intelligent' differences between two files
diff [−c | −C lines | −e | −f | −q | −s | −u | −U lines] file1 file2
The diff command compares file1 and file2, producing a listing on standard output describing how to convert one file to the other. Various formats are available for representing the file changes. By default the output is in the traditional UNIX diff format.
Two directories cannot be compared. If either file1 or file2 is a directory, diff is applied to the non−directory file and a file of the same name within the directory.
The following options are supported.
|
−c |
Produce a context diff with 3 lines of context | ||
|
−C NUM |
Produce a context diff with NUM lines of context | ||
|
−e |
Create a script for the ed editor | ||
|
−f |
Like −e but in reverse order (output cannot be processed by ed) | ||
|
−u |
Output a unified diff with 3 lines of context | ||
|
−U NUM |
Output a unified diff with NUM lines of context | ||
|
−q |
Print a message if the input files differ instead of displaying the difference. | ||
|
−s |
Print a message if the input files are identical. By default no output is produced in this case. |
Mark−Jason Dominus, "<mjd−perl−[email protected]>".
Visit my diff/LCS web page at <http://www.plover.com/˜mjd/perl/diff/>.