Below is a summary of all of the options that GNU diff accepts.
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
`--'. Multiple single letter options (unless they take an
argument) can be combined into a single command line word: `-ac' is
equivalent to `-a -c'. Long named options can be abbreviated to
any unique prefix of their name. Brackets ([ and ]) indicate that an
option takes an optional argument.
Use the context output format, showing three lines of context.
See section 2.3.1 Context Format.
`-C lines'
`--context[=lines]'
Use the context output format, showing lines (an integer) lines of
context, or three if lines is not given. See section 2.3.1 Context Format.
For proper operation, patch typically needs at least two lines of
context.
On older systems, diff supports an obsolete option
`-lines' that has effect when combined with `-c'
or `-p'. POSIX 1003.1-2001 (see section 17. Standards conformance) does not allow this; use `-C lines'
instead.
`--changed-group-format=format'
Use format to output a line group containing differing lines from
both files in if-then-else format. See section 2.6.1 Line Group Formats.
`-d'
`--minimal'
Change the algorithm perhaps find a smaller set of changes. This makes
diff slower (sometimes much slower). See section 6. diff Performance Tradeoffs.
Use format to output all input lines in if-then-else format.
See section 2.6.2 Line Formats.
`-n'
`--rcs'
Output RCS-format diffs; like `-f' except that each command
specifies the number of lines affected. See section 2.5.3 RCS Scripts.
`-N'
`--new-file'
In directory comparison, if a file is found in only one directory,
treat it as present but empty in the other directory. See section 4. Comparing Directories.
`--new-group-format=format'
Use format to output a group of lines taken from just the second
file in if-then-else format. See section 2.6.1 Line Group Formats.
`--new-line-format=format'
Use format to output a line taken from just the second file in
if-then-else format. See section 2.6.2 Line Formats.
`--old-group-format=format'
Use format to output a group of lines taken from just the first
file in if-then-else format. See section 2.6.1 Line Group Formats.
`--old-line-format=format'
Use format to output a line taken from just the first file in
if-then-else format. See section 2.6.2 Line Formats.
Expand tabs to spaces in the output, to preserve the alignment of tabs
in the input files. See section 5.1 Preserving Tab Stop Alignment.
`-T'
`--initial-tab'
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. See section 5.1 Preserving Tab Stop Alignment.
`--to-file=file'
Compare each operand to file; file may be a directory.
`-u'
Use the unified output format, showing three lines of context.
See section 2.3.2 Unified Format.
`--unchanged-group-format=format'
Use format to output a group of common lines taken from both files
in if-then-else format. See section 2.6.1 Line Group Formats.
`--unchanged-line-format=format'
Use format to output a line common to both files in if-then-else
format. See section 2.6.2 Line Formats.
`--unidirectional-new-file'
When comparing directories, if a file appears only in the second
directory of the two, treat it as present but empty in the other.
See section 4. Comparing Directories.
`-U lines'
`--unified[=lines]'
Use the unified output format, showing lines (an integer) lines of
context, or three if lines is not given. See section 2.3.2 Unified Format.
For proper operation, patch typically needs at least two lines of
context.
On older systems, diff supports an obsolete option
`-lines' that has effect when combined with `-u'.
POSIX 1003.1-2001 (see section 17. Standards conformance) does not allow
this; use `-U lines' instead.
Please take a moment to fill out
this visitor survey You can help support this site by
visiting the advertisers that sponsor it! (only once each, though)