.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
.TH DIFF "1" "January 2024" "diffutils 3.10" "User Commands"
.SH NAME
diff \- compare files line by line
.SH SYNOPSIS
.B diff
[\fIOPTION\fR]... \fIFILES\fR
.SH DESCRIPTION
Compare FILES line by line.
.PP
Mandatory arguments to long options are mandatory for short options too.
.TP
\fB\-\-normal\fR
output a normal diff (the default)
.TP
\fB\-q\fR, \fB\-\-brief\fR
report only when files differ
.TP
\fB\-s\fR, \fB\-\-report\-identical\-files\fR
report when two files are the same
.TP
\fB\-c\fR, \fB\-C\fR NUM, \fB\-\-context\fR[=\fINUM\fR]
output NUM (default 3) lines of copied context
.TP
\fB\-u\fR, \fB\-U\fR NUM, \fB\-\-unified\fR[=\fINUM\fR]
output NUM (default 3) lines of unified context
.TP
\fB\-e\fR, \fB\-\-ed\fR
output an ed script
.TP
\fB\-n\fR, \fB\-\-rcs\fR
output an RCS format diff
.TP
\fB\-y\fR, \fB\-\-side\-by\-side\fR
output in two columns
.TP
\fB\-W\fR, \fB\-\-width\fR=\fINUM\fR
output at most NUM (default 130) print columns
.TP
\fB\-\-left\-column\fR
output only the left column of common lines
.TP
\fB\-\-suppress\-common\-lines\fR
do not output common lines
.TP
\fB\-p\fR, \fB\-\-show\-c\-function\fR
show which C function each change is in
.TP
\fB\-F\fR, \fB\-\-show\-function\-line\fR=\fIRE\fR
show the most recent line matching RE
.TP
\fB\-\-label\fR LABEL
use LABEL instead of file name and timestamp
(can be repeated)
.TP
\fB\-t\fR, \fB\-\-expand\-tabs\fR
expand tabs to spaces in output
.TP
\fB\-T\fR, \fB\-\-initial\-tab\fR
make tabs line up by prepending a tab
.TP
\fB\-\-tabsize\fR=\fINUM\fR
tab stops every NUM (default 8) print columns
.TP
\fB\-\-suppress\-blank\-empty\fR
suppress space or tab before empty output lines
.TP
\fB\-l\fR, \fB\-\-paginate\fR
pass output through 'pr' to paginate it
.TP
\fB\-r\fR, \fB\-\-recursive\fR
recursively compare any subdirectories found
.TP
\fB\-\-no\-dereference\fR
don't follow symbolic links
.TP
\fB\-N\fR, \fB\-\-new\-file\fR
treat absent files as empty
.TP
\fB\-\-unidirectional\-new\-file\fR
treat absent first files as empty
.TP
\fB\-\-ignore\-file\-name\-case\fR
ignore case when comparing file names
.TP
\fB\-\-no\-ignore\-file\-name\-case\fR
consider case when comparing file names
.TP
\fB\-x\fR, \fB\-\-exclude\fR=\fIPAT\fR
exclude files that match PAT
.TP
\fB\-X\fR, \fB\-\-exclude\-from\fR=\fIFILE\fR
exclude files that match any pattern in FILE
.TP
\fB\-S\fR, \fB\-\-starting\-file\fR=\fIFILE\fR
start with FILE when comparing directories
.TP
\fB\-\-from\-file\fR=\fIFILE1\fR
compare FILE1 to all operands;
FILE1 can be a directory
.TP
\fB\-\-to\-file\fR=\fIFILE2\fR
compare all operands to FILE2;
FILE2 can be a directory
.TP
\fB\-i\fR, \fB\-\-ignore\-case\fR
ignore case differences in file contents
.TP
\fB\-E\fR, \fB\-\-ignore\-tab\-expansion\fR
ignore changes due to tab expansion
.TP
\fB\-Z\fR, \fB\-\-ignore\-trailing\-space\fR
ignore white space at line end
.TP
\fB\-b\fR, \fB\-\-ignore\-space\-change\fR
ignore changes in the amount of white space
.TP
\fB\-w\fR, \fB\-\-ignore\-all\-space\fR
ignore all white space
.TP
\fB\-B\fR, \fB\-\-ignore\-blank\-lines\fR
ignore changes where lines are all blank
.TP
\fB\-I\fR, \fB\-\-ignore\-matching\-lines\fR=\fIRE\fR
ignore changes where all lines match RE
.TP
\fB\-a\fR, \fB\-\-text\fR
treat all files as text
.TP
\fB\-\-strip\-trailing\-cr\fR
strip trailing carriage return on input
.TP
\fB\-D\fR, \fB\-\-ifdef\fR=\fINAME\fR
output merged file with '#ifdef NAME' diffs
.TP
\fB\-\-GTYPE\-group\-format\fR=\fIGFMT\fR
format GTYPE input groups with GFMT
.TP
\fB\-\-line\-format\fR=\fILFMT\fR
format all input lines with LFMT
.TP
\fB\-\-LTYPE\-line\-format\fR=\fILFMT\fR
format LTYPE input lines with LFMT
.IP
These format options provide fine\-grained control over the output
.IP
of diff, generalizing \fB\-D\fR/\-\-ifdef.
.TP
LTYPE is 'old', 'new', or 'unchanged'.
GTYPE is LTYPE or 'changed'.
.IP
GFMT (only) may contain:
.TP
%<
lines from FILE1
.TP
%>
lines from FILE2
.TP
%=
lines common to FILE1 and FILE2
.TP
%[\-][WIDTH][.[PREC]]{doxX}LETTER
printf\-style spec for LETTER
.IP
LETTERs are as follows for new group, lower case for old group:
.TP
F
first line number
.TP
L
last line number
.TP
N
number of lines = L\-F+1
.TP
E
F\-1
.TP
M
L+1
.TP
%(A=B?T:E)
if A equals B then T else E
.IP
LFMT (only) may contain:
.TP
%L
contents of line
.TP
%l
contents of line, excluding any trailing newline
.TP
%[\-][WIDTH][.[PREC]]{doxX}n
printf\-style spec for input line number
.IP
Both GFMT and LFMT may contain:
.TP
%%
%
.TP
%c'C'
the single character C
.TP
%c'\eOOO'
the character with octal code OOO
.TP
C
the character C (other characters represent themselves)
.TP
\fB\-d\fR, \fB\-\-minimal\fR
try hard to find a smaller set of changes
.TP
\fB\-\-horizon\-lines\fR=\fINUM\fR
keep NUM lines of the common prefix and suffix
.TP
\fB\-\-speed\-large\-files\fR
assume large files and many scattered small changes
.TP
\fB\-\-color\fR[=\fIWHEN\fR]
color output; WHEN is 'never', 'always', or 'auto';
plain \fB\-\-color\fR means \fB\-\-color=\fR'auto'
.TP
\fB\-\-palette\fR=\fIPALETTE\fR
the colors to use when \fB\-\-color\fR is active; PALETTE is
a colon\-separated list of terminfo capabilities
.TP
\fB\-\-help\fR
display this help and exit
.TP
\fB\-v\fR, \fB\-\-version\fR
output version information and exit
.PP
FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'.
If \fB\-\-from\-file\fR or \fB\-\-to\-file\fR is given, there are no restrictions on FILE(s).
If a FILE is '\-', read standard input.
Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
.SH AUTHOR
Written by Paul Eggert, Mike Haertel, David Hayes,
Richard Stallman, and Len Tower.
.SH "REPORTING BUGS"
Report bugs to: bug\-diffutils@gnu.org
.br
GNU diffutils home page:
.br
General help using GNU software:
.SH COPYRIGHT
Copyright \(co 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.SH "SEE ALSO"
.BR wdiff (1),
.BR cmp (1),
.BR diff3 (1),
.BR sdiff (1),
.BR patch (1)
.PP
The full documentation for
.B diff
is maintained as a Texinfo manual. If the
.B info
and
.B diff
programs are properly installed at your site, the command
.IP
.B info diff
.PP
should give you access to the complete manual.