d
diff(1) | diff(1) |
NAME
diff - differential ®le and directory comparator
SYNOPSIS
diff
DESCRIPTION
Comparing Directories
If both arguments are directories, diff sorts the contents of the directories by name, then runs the regular ®le diff algorithm (described below) on text ®les that have the same name in each directory but are different. Binary ®les that differ, common subdirectories, and ®les that appear in only one directory are listed. When comparing directories, the following options are recognized:
Long output format; each text ®le diff is piped through pr to paginate it (see pr(1)). | |
| Other differences are remembered and summarized after all text ®le differences are |
| reported. |
Applies diff recursively to common subdirectories encountered. | |
diff reports ®les that are identical but otherwise not mentioned. | |
Starts a directory diff in the middle of the sorted directory, beginning with ®le name. |
Comparing Files
When run on regular ®les, and when comparing text ®les that differ during directory comparison, diff tells what lines must be changed in the ®les to bring them into agreement. diff usually ®nds a smallest suf®cient set of ®le differences. However, it can be misled by lines containing very few characters or by other situations. If neither ®le1 nor ®le2 is a directory, either can be speci®ed as
There are several options for output format. The default output format contains lines resembling the fol- lowing:
n1 a n3,n4
n1,n2 d n3
n1,n2 c n3,n4
These lines resemble ed commands to convert ®le1 into ®le2. The numbers after the letters pertain to ®le2. In fact, by exchanging a for d and reading backwards one may ascertain equally how to convert ®le2 into ®le1. As in ed, identical pairs where n1 = n2 or n3 = n4 are abbreviated as a single number.
Following each of these lines come all the lines that are affected in the ®rst ®le ¯agged by <, then all the lines that are affected in the second ®le ¯agged by >.
Except for
Section 1−178 | − 1 − |