Next: diff examples, Up: diff [Contents][Index]
These standard options are supported by diff
(see Common options for a complete description of
them):
-D date
Use the most recent revision no later than date. See ‘-r’ for how this affects the comparison.
-k kflag
Process keywords according to kflag. See Keyword substitution.
-l
Local; run only in current working directory.
-R
Examine directories recursively. This option is on by default.
-r tag
Compare with revision tag. Zero, one or two ‘-r’ options can be present. With no ‘-r’ option, the working file will be compared with the revision it was based on. With one ‘-r’, that revision will be compared to your current working file. With two ‘-r’ options those two revisions will be compared (and your working file will not affect the outcome in any way).
One or both ‘-r’ options can be replaced by a ‘-D date’ option, described above.
The following options specify the format of the output. They have the same meaning as in GNU diff. Most options have two equivalent names, one of which is a single letter preceded by ‘-’, and the other of which is a long name preceded by ‘--’.
Show lines (an integer) lines of context. This option does not
specify an output format by itself; it has no effect unless it is
combined with ‘-c’ or ‘-u’. This option is obsolete. For proper
operation, patch
typically needs at least two lines of context.
Treat all files as text and compare them line-by-line, even if they do not seem to be text.
Ignore trailing white space and consider all other sequences of one or more white space characters to be equivalent.
Ignore changes that just insert or delete blank lines.
Read and write data in binary mode.
Report only whether the files differ, not the details of the differences.
Use the context output format.
Use the context output format, showing lines (an integer) lines of
context, or three if lines is not given.
For proper operation, patch
typically needs at least two lines of
context.
Use format to output a line group containing differing lines from both files in if-then-else format. See Line group formats.
Change the algorithm to perhaps find a smaller set of changes. This makes
diff
slower (sometimes much slower).
Make output that is a valid ed
script.
Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files.
Make output that looks vaguely like an ed
script but has changes
in the order they appear in the file.
In context and unified format, for each hunk of differences, show some of the last preceding line that matches regexp.
Make output that looks vaguely like an ed
script but has changes
in the order they appear in the file.
Use heuristics to speed handling of large files that have numerous scattered small changes.
Do not discard the last lines lines of the common prefix and the first lines lines of the common suffix.
Ignore changes in case; consider upper- and lower-case letters equivalent.
Ignore changes that just insert or delete lines that match regexp.
Make merged if-then-else output using name.
Ignore white space when comparing lines.
Ignore changes that just insert or delete blank lines.
Ignore changes in case; consider upper- and lower-case to be the same.
Ignore changes that just insert or delete lines that match regexp.
Ignore trailing white space and consider all other sequences of one or more white space characters to be equivalent.
Output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal.
Use label instead of the file name in the context format and unified format headers.
Use label instead of the file name in the context format and unified format headers.
Print only the left column of two common lines in side by side format.
Use format to output all input lines in if-then-else format. See Line formats.
Change the algorithm to perhaps find a smaller set of changes. This
makes diff
slower (sometimes much slower).
Output RCS-format diffs; like ‘-f’ except that each command specifies the number of lines affected.
In directory comparison, if a file is found in only one directory, treat it as present but empty in the other directory.
Use format to output a group of lines taken from just the second file in if-then-else format. See Line group formats.
Use format to output a line taken from just the second file in if-then-else format. See Line formats.
Use format to output a group of lines taken from just the first file in if-then-else format. See Line group formats.
Use format to output a line taken from just the first file in if-then-else format. See Line formats.
Show which C function each change is in.
Output RCS-format diffs; like ‘-f’ except that each command specifies the number of lines affected.
Report when two files are the same.
Show which C function each change is in.
In context and unified format, for each hunk of differences, show some of the last preceding line that matches regexp.
Use the side by side output format.
Use heuristics to speed handling of large files that have numerous scattered small changes.
Do not print common lines in side by side format.
Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files.
Output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal.
Treat all files as text and compare them line-by-line, even if they do not appear to be text.
Use the unified output format.
Use format to output a group of common lines taken from both files in if-then-else format. See Line group formats.
Use format to output a line common to both files in if-then-else format. See Line formats.
Use the unified output format, showing lines (an integer) lines of
context, or three if lines is not given.
For proper operation, patch
typically needs at least two lines of
context.
Ignore white space when comparing lines.
Use an output width of columns in side by side format.
Use the side by side output format.
• Line group formats: | Line group formats | |
• Line formats: | Line formats |
Next: diff examples, Up: diff [Contents][Index]