1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.39.2.
2 .TH DIFF "1" "September 2011" "diffutils 3.2" "User Commands"
4 diff \- compare files line by line
7 [\fIOPTION\fR]... \fIFILES\fR
9 Compare FILES line by line.
11 Mandatory arguments to long options are mandatory for short options too.
14 output a normal diff (the default)
16 \fB\-q\fR, \fB\-\-brief\fR
17 report only when files differ
19 \fB\-s\fR, \fB\-\-report\-identical\-files\fR
20 report when two files are the same
22 \fB\-c\fR, \fB\-C\fR NUM, \fB\-\-context\fR[=\fINUM\fR]
23 output NUM (default 3) lines of copied context
25 \fB\-u\fR, \fB\-U\fR NUM, \fB\-\-unified\fR[=\fINUM\fR]
26 output NUM (default 3) lines of unified context
28 \fB\-e\fR, \fB\-\-ed\fR
31 \fB\-n\fR, \fB\-\-rcs\fR
32 output an RCS format diff
34 \fB\-y\fR, \fB\-\-side\-by\-side\fR
37 \fB\-W\fR, \fB\-\-width\fR=\fINUM\fR
38 output at most NUM (default 130) print columns
40 \fB\-\-left\-column\fR
41 output only the left column of common lines
43 \fB\-\-suppress\-common\-lines\fR
44 do not output common lines
46 \fB\-p\fR, \fB\-\-show\-c\-function\fR
47 show which C function each change is in
49 \fB\-F\fR, \fB\-\-show\-function\-line\fR=\fIRE\fR
50 show the most recent line matching RE
53 use LABEL instead of file name
56 \fB\-t\fR, \fB\-\-expand\-tabs\fR
57 expand tabs to spaces in output
59 \fB\-T\fR, \fB\-\-initial\-tab\fR
60 make tabs line up by prepending a tab
62 \fB\-\-tabsize\fR=\fINUM\fR
63 tab stops every NUM (default 8) print columns
65 \fB\-\-suppress\-blank\-empty\fR
66 suppress space or tab before empty output lines
68 \fB\-l\fR, \fB\-\-paginate\fR
69 pass output through `pr' to paginate it
71 \fB\-r\fR, \fB\-\-recursive\fR
72 recursively compare any subdirectories found
74 \fB\-N\fR, \fB\-\-new\-file\fR
75 treat absent files as empty
77 \fB\-\-unidirectional\-new\-file\fR
78 treat absent first files as empty
80 \fB\-\-ignore\-file\-name\-case\fR
81 ignore case when comparing file names
83 \fB\-\-no\-ignore\-file\-name\-case\fR
84 consider case when comparing file names
86 \fB\-x\fR, \fB\-\-exclude\fR=\fIPAT\fR
87 exclude files that match PAT
89 \fB\-X\fR, \fB\-\-exclude\-from\fR=\fIFILE\fR
90 exclude files that match any pattern in FILE
92 \fB\-S\fR, \fB\-\-starting\-file\fR=\fIFILE\fR
93 start with FILE when comparing directories
95 \fB\-\-from\-file\fR=\fIFILE1\fR
96 compare FILE1 to all operands;
97 FILE1 can be a directory
99 \fB\-\-to\-file\fR=\fIFILE2\fR
100 compare all operands to FILE2;
101 FILE2 can be a directory
103 \fB\-i\fR, \fB\-\-ignore\-case\fR
104 ignore case differences in file contents
106 \fB\-E\fR, \fB\-\-ignore\-tab\-expansion\fR
107 ignore changes due to tab expansion
109 \fB\-b\fR, \fB\-\-ignore\-space\-change\fR
110 ignore changes in the amount of white space
112 \fB\-w\fR, \fB\-\-ignore\-all\-space\fR
113 ignore all white space
115 \fB\-B\fR, \fB\-\-ignore\-blank\-lines\fR
116 ignore changes whose lines are all blank
118 \fB\-I\fR, \fB\-\-ignore\-matching\-lines\fR=\fIRE\fR
119 ignore changes whose lines all match RE
121 \fB\-a\fR, \fB\-\-text\fR
122 treat all files as text
124 \fB\-\-strip\-trailing\-cr\fR
125 strip trailing carriage return on input
127 \fB\-D\fR, \fB\-\-ifdef\fR=\fINAME\fR
128 output merged file with `#ifdef NAME' diffs
130 \fB\-\-GTYPE\-group\-format\fR=\fIGFMT\fR
131 format GTYPE input groups with GFMT
133 \fB\-\-line\-format\fR=\fILFMT\fR
134 format all input lines with LFMT
136 \fB\-\-LTYPE\-line\-format\fR=\fILFMT\fR
137 format LTYPE input lines with LFMT
139 These format options provide fine\-grained control over the output
141 of diff, generalizing \fB\-D\fR/\-\-ifdef.
143 LTYPE is `old', `new', or `unchanged'.
144 GTYPE is LTYPE or `changed'.
146 GFMT (only) may contain:
155 lines common to FILE1 and FILE2
157 %[\-][WIDTH][.[PREC]]{doxX}LETTER
158 printf\-style spec for LETTER
160 LETTERs are as follows for new group, lower case for old group:
169 number of lines = L\-F+1
178 if A equals B then T else E
180 LFMT (only) may contain:
186 contents of line, excluding any trailing newline
188 %[\-][WIDTH][.[PREC]]{doxX}n
189 printf\-style spec for input line number
191 Both GFMT and LFMT may contain:
197 the single character C
200 the character with octal code OOO
203 the character C (other characters represent themselves)
205 \fB\-d\fR, \fB\-\-minimal\fR
206 try hard to find a smaller set of changes
208 \fB\-\-horizon\-lines\fR=\fINUM\fR
209 keep NUM lines of the common prefix and suffix
211 \fB\-\-speed\-large\-files\fR
212 assume large files and many scattered small changes
215 display this help and exit
217 \fB\-v\fR, \fB\-\-version\fR
218 output version information and exit
220 FILES are `FILE1 FILE2' or `DIR1 DIR2' or `DIR FILE...' or `FILE... DIR'.
221 If \fB\-\-from\-file\fR or \fB\-\-to\-file\fR is given, there are no restrictions on FILE(s).
222 If a FILE is `\-', read standard input.
223 Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
225 Written by Paul Eggert, Mike Haertel, David Hayes,
226 Richard Stallman, and Len Tower.
228 Report bugs to: bug\-diffutils@gnu.org
230 GNU diffutils home page: <http://www.gnu.org/software/diffutils/>
232 General help using GNU software: <http://www.gnu.org/gethelp/>
234 Copyright \(co 2011 Free Software Foundation, Inc.
235 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
237 This is free software: you are free to change and redistribute it.
238 There is NO WARRANTY, to the extent permitted by law.
240 wdiff(1), cmp(1), diff3(1), sdiff(1), patch(1)
242 The full documentation for
244 is maintained as a Texinfo manual. If the
248 programs are properly installed at your site, the command
252 should give you access to the complete manual.