1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
2 .TH DIFF "1" "March 2013" "diffutils 3.3" "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\-Z\fR, \fB\-\-ignore\-trailing\-space\fR
110 ignore white space at line end
112 \fB\-b\fR, \fB\-\-ignore\-space\-change\fR
113 ignore changes in the amount of white space
115 \fB\-w\fR, \fB\-\-ignore\-all\-space\fR
116 ignore all white space
118 \fB\-B\fR, \fB\-\-ignore\-blank\-lines\fR
119 ignore changes whose lines are all blank
121 \fB\-I\fR, \fB\-\-ignore\-matching\-lines\fR=\fIRE\fR
122 ignore changes whose lines all match RE
124 \fB\-a\fR, \fB\-\-text\fR
125 treat all files as text
127 \fB\-\-strip\-trailing\-cr\fR
128 strip trailing carriage return on input
130 \fB\-D\fR, \fB\-\-ifdef\fR=\fINAME\fR
131 output merged file with `#ifdef NAME' diffs
133 \fB\-\-GTYPE\-group\-format\fR=\fIGFMT\fR
134 format GTYPE input groups with GFMT
136 \fB\-\-line\-format\fR=\fILFMT\fR
137 format all input lines with LFMT
139 \fB\-\-LTYPE\-line\-format\fR=\fILFMT\fR
140 format LTYPE input lines with LFMT
142 These format options provide fine\-grained control over the output
144 of diff, generalizing \fB\-D\fR/\-\-ifdef.
146 LTYPE is `old', `new', or `unchanged'.
147 GTYPE is LTYPE or `changed'.
149 GFMT (only) may contain:
158 lines common to FILE1 and FILE2
160 %[\-][WIDTH][.[PREC]]{doxX}LETTER
161 printf\-style spec for LETTER
163 LETTERs are as follows for new group, lower case for old group:
172 number of lines = L\-F+1
181 if A equals B then T else E
183 LFMT (only) may contain:
189 contents of line, excluding any trailing newline
191 %[\-][WIDTH][.[PREC]]{doxX}n
192 printf\-style spec for input line number
194 Both GFMT and LFMT may contain:
200 the single character C
203 the character with octal code OOO
206 the character C (other characters represent themselves)
208 \fB\-d\fR, \fB\-\-minimal\fR
209 try hard to find a smaller set of changes
211 \fB\-\-horizon\-lines\fR=\fINUM\fR
212 keep NUM lines of the common prefix and suffix
214 \fB\-\-speed\-large\-files\fR
215 assume large files and many scattered small changes
218 display this help and exit
220 \fB\-v\fR, \fB\-\-version\fR
221 output version information and exit
223 FILES are `FILE1 FILE2' or `DIR1 DIR2' or `DIR FILE...' or `FILE... DIR'.
224 If \fB\-\-from\-file\fR or \fB\-\-to\-file\fR is given, there are no restrictions on FILE(s).
225 If a FILE is `\-', read standard input.
226 Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
228 Written by Paul Eggert, Mike Haertel, David Hayes,
229 Richard Stallman, and Len Tower.
231 Report bugs to: bug\-diffutils@gnu.org
233 GNU diffutils home page: <http://www.gnu.org/software/diffutils/>
235 General help using GNU software: <http://www.gnu.org/gethelp/>
237 Copyright \(co 2011 Free Software Foundation, Inc.
238 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
240 This is free software: you are free to change and redistribute it.
241 There is NO WARRANTY, to the extent permitted by law.
243 wdiff(1), cmp(1), diff3(1), sdiff(1), patch(1)
245 The full documentation for
247 is maintained as a Texinfo manual. If the
251 programs are properly installed at your site, the command
255 should give you access to the complete manual.