NAME diff - isolate differences between files SYNOPSIS diff [-{c|d|r|s|v}] [] DESCRIPTION 'Diff' compares the contents of two files and reports on the differences between them. The default behavior is to describe the insert, delete, and change operations that must be performed on to convert its contents into those of . [Editor's note: the default output is evidently only useful at Georgia Tech. The tool should generally be called by 'diff -s' to produce an editor script, or 'diff -cv' to produce output similar to that generated by the tool 'cmp'.] The second file name argument is optional. If omitted, the standard input is read for the text of the . The options currently available are: -c Perform a simple line-by-line comparison. 'Diff' will compare successive lines of the input files; if any corresponding lines differ, or if one file is shorter than the other, 'diff' prints the message "different" and exits. If the files are the same, 'diff' produces no output. When the "-v" option (see below) is specified, 'diff' prints the lines that differ along with their line number in the input file, and notifies the user if one file is shorter than the other. -d List the "differences" between the two files, by highlighting the insertions, deletions, and changes that will convert into . This is the default option. If the "verbose" option "-v" (see below) is specified, unchanged text will also be listed. -r Insert text formatter requests to mark the with revision bars and deletion asterisks. This option is particularly useful for maintenance of large documents, like Software Tools reference manuals. (At present, only GT's version of 'format' can produce revision bars.) -s Output a "script" of commands for the text editor 'ed' that will convert into . This is handy for preparing updates to large programs or data files, since generally the volume of changes required will be much smaller than the new text in its entirety. -v Make output "verbose." This option applies to the "-c" and "-d" options discussed above. If not selected, 'diff' produces "concise" output; if selected, 'diff' produces more verbiage. 'Diff' is based on the algorithm found in Heckel, P., "A Technique for Isolating Differences Between Files", Comm. ACM 21, 4 (April 1978), 264-268. Examples: diff myfile1 myfile2 diff rf.r nrf.r | pg diff -c afile maybe_the_same_file diff -v rf.r nrf.r | sp diff -r old_manual.fmt new_manual.fmt | fmt diff -s old new >>update_old_to_new DIAGNOSTICS ": can't open" if either or is not readable. "Usage: diff . . ." for illegal options. AUTHORS Allen Akin and friends, Georgia Institute of Technology BUGS/DEFICIENCIES The algorithm used has one quirk: a line or a block of lines which is not unique within a file will be labeled as an insertion (deletion) if its immediately adjacent neighbors both above and below are labeled as insertions (deletions). Fails on very large files (> 10000 lines).