1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4.
2 .TH GNU "1" "December 2018" "diffutils 3.7" "User Commands"
4 GNU 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 and timestamp
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\-\-no\-dereference\fR
75 don't follow symbolic links
77 \fB\-N\fR, \fB\-\-new\-file\fR
78 treat absent files as empty
80 \fB\-\-unidirectional\-new\-file\fR
81 treat absent first files as empty
83 \fB\-\-ignore\-file\-name\-case\fR
84 ignore case when comparing file names
86 \fB\-\-no\-ignore\-file\-name\-case\fR
87 consider case when comparing file names
89 \fB\-x\fR, \fB\-\-exclude\fR=\fIPAT\fR
90 exclude files that match PAT
92 \fB\-X\fR, \fB\-\-exclude\-from\fR=\fIFILE\fR
93 exclude files that match any pattern in FILE
95 \fB\-S\fR, \fB\-\-starting\-file\fR=\fIFILE\fR
96 start with FILE when comparing directories
98 \fB\-\-from\-file\fR=\fIFILE1\fR
99 compare FILE1 to all operands;
100 FILE1 can be a directory
102 \fB\-\-to\-file\fR=\fIFILE2\fR
103 compare all operands to FILE2;
104 FILE2 can be a directory
106 \fB\-i\fR, \fB\-\-ignore\-case\fR
107 ignore case differences in file contents
109 \fB\-E\fR, \fB\-\-ignore\-tab\-expansion\fR
110 ignore changes due to tab expansion
112 \fB\-Z\fR, \fB\-\-ignore\-trailing\-space\fR
113 ignore white space at line end
115 \fB\-b\fR, \fB\-\-ignore\-space\-change\fR
116 ignore changes in the amount of white space
118 \fB\-w\fR, \fB\-\-ignore\-all\-space\fR
119 ignore all white space
121 \fB\-B\fR, \fB\-\-ignore\-blank\-lines\fR
122 ignore changes where lines are all blank
124 \fB\-I\fR, \fB\-\-ignore\-matching\-lines\fR=\fIRE\fR
125 ignore changes where all lines match RE
127 \fB\-a\fR, \fB\-\-text\fR
128 treat all files as text
130 \fB\-\-strip\-trailing\-cr\fR
131 strip trailing carriage return on input
133 \fB\-D\fR, \fB\-\-ifdef\fR=\fINAME\fR
134 output merged file with '#ifdef NAME' diffs
136 \fB\-\-GTYPE\-group\-format\fR=\fIGFMT\fR
137 format GTYPE input groups with GFMT
139 \fB\-\-line\-format\fR=\fILFMT\fR
140 format all input lines with LFMT
142 \fB\-\-LTYPE\-line\-format\fR=\fILFMT\fR
143 format LTYPE input lines with LFMT
145 These format options provide fine\-grained control over the output
147 of diff, generalizing \fB\-D\fR/\-\-ifdef.
149 LTYPE is 'old', 'new', or 'unchanged'.
150 GTYPE is LTYPE or 'changed'.
152 GFMT (only) may contain:
161 lines common to FILE1 and FILE2
163 %[\-][WIDTH][.[PREC]]{doxX}LETTER
164 printf\-style spec for LETTER
166 LETTERs are as follows for new group, lower case for old group:
175 number of lines = L\-F+1
184 if A equals B then T else E
186 LFMT (only) may contain:
192 contents of line, excluding any trailing newline
194 %[\-][WIDTH][.[PREC]]{doxX}n
195 printf\-style spec for input line number
197 Both GFMT and LFMT may contain:
203 the single character C
206 the character with octal code OOO
209 the character C (other characters represent themselves)
211 \fB\-d\fR, \fB\-\-minimal\fR
212 try hard to find a smaller set of changes
214 \fB\-\-horizon\-lines\fR=\fINUM\fR
215 keep NUM lines of the common prefix and suffix
217 \fB\-\-speed\-large\-files\fR
218 assume large files and many scattered small changes
220 \fB\-\-color\fR[=\fIWHEN\fR]
221 colorize the output; WHEN can be 'never', 'always',
222 or 'auto' (the default)
224 \fB\-\-palette\fR=\fIPALETTE\fR
225 the colors to use when \fB\-\-color\fR is active; PALETTE is
226 a colon\-separated list of terminfo capabilities
229 display this help and exit
231 \fB\-v\fR, \fB\-\-version\fR
232 output version information and exit
234 FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'.
235 If \fB\-\-from\-file\fR or \fB\-\-to\-file\fR is given, there are no restrictions on FILE(s).
236 If a FILE is '\-', read standard input.
237 Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
239 Written by Paul Eggert, Mike Haertel, David Hayes,
240 Richard Stallman, and Len Tower.
242 Report bugs to: bug\-diffutils@gnu.org
244 GNU diffutils home page: <https://www.gnu.org/software/diffutils/>
246 General help using GNU software: <https://www.gnu.org/gethelp/>
248 Copyright \(co 2018 Free Software Foundation, Inc.
249 License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
251 This is free software: you are free to change and redistribute it.
252 There is NO WARRANTY, to the extent permitted by law.
254 wdiff(1), cmp(1), diff3(1), sdiff(1), patch(1)
256 The full documentation for
258 is maintained as a Texinfo manual. If the
262 programs are properly installed at your site, the command
266 should give you access to the complete manual.