diff

Name

diff -- find differences between two files

Description

diff is as specified in the SUS but with differences as listed below.

LSB Deprecated Differences

The behaviors specified in this section are expected to disappear from a future version of the LSB; applications should only use the non-LSB-deprecated behaviors.

-a

treats all files as text and compares them line-by-line, even if they do not seem to be text.

-B

ignores changes that just insert or delete blank lines.

--brief

reports only whether the files differ, not the details of the differences.

--context[=lines]

is equivalent to -C as specified in the SUS.

-d

changes the algorithm to perhaps find a smaller set of changes; this makes diff slower (sometimes much slower).

-D name

makes merged if-then-else format output conditional on the preprocessor macro name.

--ed

is equivalent to -e as specified in the SUS.

--exclude=pattern

when comparing directories, ignores files and subdirectories whose basenames match pattern.

--exclude-from=file

when comparing directories, ignores files and subdirectories whose basenames match any pattern contained in file.

--expand-tabs

expands tabs to spaces in the output to preserve the alignment of tabs in the input files.

-F regexp

in context and unified format, shows some of the last preceding line that matches regexp for each hunk of differences.

--forward-ed

makes output that looks vaguely like an ed script, but has changes in the order they appear in the file.

-H

uses heuristics to speed handling of large files that have numerous scattered small changes.

--horizon-lines=lines

does not discard the last lines lines of the common prefix and the first lines lines of the common suffix.

-i

ignores changes in case; considers upper and lower case letters equivalent.

-I regexp

ignores changes that just insert or delete lines that match regexp.

--ifdef=name

makes merged if-then-else format output conditional on the preprocessor macro name.

--ignore-all-space

ignores white space when comparing lines.

--ignore-case

ignores changes in case; considers upper and lower case to be the same.

--ignore-matching-lines=regexp

ignores changes that just insert or delete lines that match regexp.

--ignore-space-change

ignores changes in amount of white space.

--initial-tab

outputs 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.

-l

passes the output through pr to paginate it.

--ignore-case

ignores changes in case; considers upper and lower case to be the same.