NAME

diff - compare files line by line

SYNOPSIS

diff [_O_P_T_I_O_N]... _F_I_L_E_S

DESCRIPTION

Compare files line by line.
--ii ----iiggnnoorree--ccaassee
Ignore case differences in file contents.
----iiggnnoorree--ffiillee--nnaammee--ccaassee
Ignore case when comparing file names.
----nnoo--iiggnnoorree--ffiillee--nnaammee--ccaassee
Consider case when comparing file names.
--EE ----iiggnnoorree--ttaabb--eexxppaannssiioonn
Ignore changes due to tab expansion.
--bb ----iiggnnoorree--ssppaaccee--cchhaannggee
Ignore changes in the amount of white space.
--ww ----iiggnnoorree--aallll--ssppaaccee
Ignore all white space.
--BB ----iiggnnoorree--bbllaannkk--lliinneess
Ignore changes whose lines are all blank.
--II RE ----iiggnnoorree--mmaattcchhiinngg--lliinneess=_R_E
Ignore changes whose lines all match RE.
----ssttrriipp--ttrraaiilliinngg--ccrr
Strip trailing carriage return on input.
--aa ----tteexxtt
Treat all files as text.
--cc --CC NUM ----ccoonntteexxtt[=_N_U_M]
Output NUM (default 3) lines of copied context.
--uu --UU NUM ----uunniiffiieedd[=_N_U_M]
Output NUM (default 3) lines of unified context.
----llaabbeell LABEL
Use LABEL instead of file name.
--pp ----sshhooww--cc--ffuunnccttiioonn
Show which C function each change is in.
--FF RE ----sshhooww--ffuunnccttiioonn--lliinnee=_R_E
Show the most recent line matching RE.
--qq ----bbrriieeff
Output only whether files differ.
--ee ----eedd
Output an ed script.
----nnoorrmmaall
Output a normal diff.
--nn ----rrccss
Output an RCS format diff.
--yy ----ssiiddee--bbyy--ssiiddee
Output in two columns.
--WW NUM ----wwiiddtthh=_N_U_M
Output at most NUM (default 130) print columns.
----lleefftt--ccoolluummnn
Output only the left column of common lines.
----ssuupppprreessss--ccoommmmoonn--lliinneess
Do not output common lines.
--DD NAME ----iiffddeeff=_N_A_M_E
Output merged file to show `#ifdef NAME' diffs.
----GGTTYYPPEE--ggrroouupp--ffoorrmmaatt=_G_F_M_T
Similar, but format GTYPE input groups with GFMT.
----lliinnee--ffoorrmmaatt=_L_F_M_T
Similar, but format all input lines with LFMT.
----LLTTYYPPEE--lliinnee--ffoorrmmaatt=_L_F_M_T
Similar, but format LTYPE input lines with LFMT.
LTYPE is `old', `new', or `unchanged'.
GTYPE is LTYPE or `changed'.
GFMT may contain:
%<
lines from FILE1
%>
lines from FILE2
%=
lines common to FILE1 and FILE2
%[-][WIDTH][.[PREC]]{doxX}LETTER
printf-style spec for LETTER
LETTERs are as follows for new group, lower case for old group:
F
first line number
L
last line number
N
number of lines = L-F+1
E
F-1
M
L+1
LFMT may contain:
%L
contents of line
%l
contents of line, excluding any trailing newline
%[-][WIDTH][.[PREC]]{doxX}n
printf-style spec for input line number
Either GFMT or LFMT may contain:
%%
%
%c'C'
the single character C
%c'\OOO'
the character with octal code OOO
--ll ----ppaaggiinnaattee
Pass the output through `pr' to paginate it.
--tt ----eexxppaanndd--ttaabbss
Expand tabs to spaces in output.
--TT ----iinniittiiaall--ttaabb
Make tabs line up by prepending a tab.
--rr ----rreeccuurrssiivvee
Recursively compare any subdirectories found.
--NN ----nneeww--ffiillee
Treat absent files as empty.
----uunniiddiirreeccttiioonnaall--nneeww--ffiillee
Treat absent first files as empty.
--ss ----rreeppoorrtt--iiddeennttiiccaall--ffiilleess
Report when two files are the same.
--xx PAT ----eexxcclluuddee=_P_A_T
Exclude files that match PAT.
--XX FILE ----eexxcclluuddee--ffrroomm=_F_I_L_E
Exclude files that match any pattern in FILE.
--SS FILE ----ssttaarrttiinngg--ffiillee=_F_I_L_E
Start with FILE when comparing directories.
----ffrroomm--ffiillee=_F_I_L_E_1
Compare FILE1 to all operands. FILE1 can be a directory.
----ttoo--ffiillee=_F_I_L_E_2
Compare all operands to FILE2. FILE2 can be a directory.
----hhoorriizzoonn--lliinneess=_N_U_M
Keep NUM lines of the common prefix and suffix.
--dd ----mmiinniimmaall
Try hard to find a smaller set of changes.
----ssppeeeedd--llaarrggee--ffiilleess
Assume large files and many scattered small changes.
--vv ----vveerrssiioonn
Output version info.
----hheellpp
Output this help.

FILES are `FILE1 FILE2' or `DIR1 DIR2' or `DIR FILE...' or `FILE... DIR'. If ----ffrroomm--ffiillee or ----ttoo--ffiillee is given, there are no restrictions on FILES. If a FILE is `-', read standard input.

AUTHOR

Written by Paul Eggert, Mike Haertel, David Hayes, Richard Stallman, and Len Tower.

REPORTING BUGS

Report bugs to . Copyright © 2002 Free Software Foundation, Inc.

This program comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of this program under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING.

SEE ALSO

The full documentation for diff is maintained as a Texinfo manual. If the info and diff programs are properly installed at your site, the command
info diff

should give you access to the complete manual.