]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/diff/diff.1
kboot: Avoid UB in signed shift
[FreeBSD/FreeBSD.git] / usr.bin / diff / diff.1
1 .\" $OpenBSD: diff.1,v 1.47 2015/11/24 19:35:41 jmc Exp $
2 .\"
3 .\" Copyright (c) 1980, 1990, 1993
4 .\"     The Regents of the University of California.  All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\"    may be used to endorse or promote products derived from this software
16 .\"    without specific prior written permission.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" SUCH DAMAGE.
29 .\"
30 .Dd February 26, 2024
31 .Dt DIFF 1
32 .Os
33 .Sh NAME
34 .Nm diff
35 .Nd differential file and directory comparator
36 .Sh SYNOPSIS
37 .Nm diff
38 .Op Fl aBbdipTtw
39 .Oo
40 .Fl c | e | f |
41 .Fl n | q | u | y
42 .Oc
43 .Op Fl -brief
44 .Op Fl -color Ns = Ns Ar when
45 .Op Fl -changed-group-format Ar GFMT
46 .Op Fl -ed
47 .Op Fl -expand-tabs
48 .Op Fl -forward-ed
49 .Op Fl -ignore-all-space
50 .Op Fl -ignore-case
51 .Op Fl -ignore-space-change
52 .Op Fl -initial-tab
53 .Op Fl -minimal
54 .Op Fl -no-ignore-file-name-case
55 .Op Fl -normal
56 .Op Fl -rcs
57 .Op Fl -show-c-function
58 .Op Fl -starting-file
59 .Op Fl -speed-large-files
60 .Op Fl -strip-trailing-cr
61 .Op Fl -tabsize Ar number
62 .Op Fl -text
63 .Op Fl -unified
64 .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern
65 .Op Fl F Ar pattern | Fl -show-function-line Ar pattern
66 .Op Fl L Ar label | Fl -label Ar label
67 .Ar file1 file2
68 .Nm diff
69 .Op Fl aBbdilpTtw
70 .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern
71 .Op Fl F Ar pattern | Fl -show-function-line Ar pattern
72 .Op Fl L Ar label | Fl -label Ar label
73 .Op Fl -brief
74 .Op Fl -color Ns = Ns Ar when
75 .Op Fl -changed-group-format Ar GFMT
76 .Op Fl -ed
77 .Op Fl -expand-tabs
78 .Op Fl -forward-ed
79 .Op Fl -ignore-all-space
80 .Op Fl -ignore-case
81 .Op Fl -ignore-space-change
82 .Op Fl -initial-tab
83 .Op Fl -minimal
84 .Op Fl -no-ignore-file-name-case
85 .Op Fl -normal
86 .Op Fl -paginate
87 .Op Fl -rcs
88 .Op Fl -show-c-function
89 .Op Fl -speed-large-files
90 .Op Fl -starting-file
91 .Op Fl -strip-trailing-cr
92 .Op Fl -tabsize Ar number
93 .Op Fl -text
94 .Fl C Ar number | -context Ar number
95 .Ar file1 file2
96 .Nm diff
97 .Op Fl aBbdiltw
98 .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern
99 .Op Fl -brief
100 .Op Fl -color Ns = Ns Ar when
101 .Op Fl -changed-group-format Ar GFMT
102 .Op Fl -ed
103 .Op Fl -expand-tabs
104 .Op Fl -forward-ed
105 .Op Fl -ignore-all-space
106 .Op Fl -ignore-case
107 .Op Fl -ignore-space-change
108 .Op Fl -initial-tab
109 .Op Fl -minimal
110 .Op Fl -no-ignore-file-name-case
111 .Op Fl -normal
112 .Op Fl -paginate
113 .Op Fl -rcs
114 .Op Fl -show-c-function
115 .Op Fl -speed-large-files
116 .Op Fl -starting-file
117 .Op Fl -strip-trailing-cr
118 .Op Fl -tabsize Ar number
119 .Op Fl -text
120 .Fl D Ar string | Fl -ifdef Ar string
121 .Ar file1 file2
122 .Nm diff
123 .Op Fl aBbdilpTtw
124 .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern
125 .Op Fl F Ar pattern | Fl -show-function-line Ar pattern
126 .Op Fl L Ar label | Fl -label Ar label
127 .Op Fl -brief
128 .Op Fl -color Ns = Ns Ar when
129 .Op Fl -changed-group-format Ar GFMT
130 .Op Fl -ed
131 .Op Fl -expand-tabs
132 .Op Fl -forward-ed
133 .Op Fl -ignore-all-space
134 .Op Fl -ignore-case
135 .Op Fl -ignore-space-change
136 .Op Fl -initial-tab
137 .Op Fl -minimal
138 .Op Fl -no-ignore-file-name-case
139 .Op Fl -normal
140 .Op Fl -paginate
141 .Op Fl -rcs
142 .Op Fl -show-c-function
143 .Op Fl -speed-large-files
144 .Op Fl -starting-file
145 .Op Fl -strip-trailing-cr
146 .Op Fl -tabsize Ar number
147 .Op Fl -text
148 .Fl U Ar number | Fl -unified Ar number
149 .Ar file1 file2
150 .Nm diff
151 .Op Fl aBbdilNPprsTtw
152 .Oo
153 .Fl c | e | f |
154 .Fl n | q | u
155 .Oc
156 .Op Fl -brief
157 .Op Fl -color Ns = Ns Ar when
158 .Op Fl -changed-group-format Ar GFMT
159 .Op Fl -context
160 .Op Fl -ed
161 .Op Fl -expand-tabs
162 .Op Fl -forward-ed
163 .Op Fl -ignore-all-space
164 .Op Fl -ignore-case
165 .Op Fl -ignore-space-change
166 .Op Fl -initial-tab
167 .Op Fl -minimal
168 .Op Fl -new-file
169 .Op Fl -no-ignore-file-name-case
170 .Op Fl -normal
171 .Op Fl -paginate
172 .Op Fl -rcs
173 .Op Fl -recursive
174 .Op Fl -report-identical-files
175 .Op Fl -show-c-function
176 .Op Fl -speed-large-files
177 .Op Fl -strip-trailing-cr
178 .Op Fl -tabsize Ar number
179 .Op Fl -text
180 .Op Fl -unidirectional-new-file
181 .Op Fl -unified
182 .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern
183 .Op Fl F Ar pattern | Fl -show-function-line Ar pattern
184 .Bk -words
185 .Op Fl L Ar label | Fl -label Ar label
186 .Op Fl S Ar name | Fl -starting-file Ar name
187 .Op Fl X Ar file | Fl -exclude-from Ar file
188 .Op Fl x Ar pattern | Fl -exclude Ar pattern
189 .Ek
190 .Ar dir1 dir2
191 .Nm diff
192 .Op Fl aBbditwW
193 .Op Fl -color Ns = Ns Ar when
194 .Op Fl -expand-tabs
195 .Op Fl -ignore-all-blanks
196 .Op Fl -ignore-blank-lines
197 .Op Fl -ignore-case
198 .Op Fl -minimal
199 .Op Fl -no-ignore-file-name-case
200 .Op Fl -strip-trailing-cr
201 .Op Fl -suppress-common-lines
202 .Op Fl -tabsize Ar number
203 .Op Fl -text
204 .Op Fl -width
205 .Fl y | Fl -side-by-side
206 .Ar file1 file2
207 .Nm diff
208 .Op Fl -help
209 .Op Fl -version
210 .Sh DESCRIPTION
211 The
212 .Nm
213 utility compares the contents of
214 .Ar file1
215 and
216 .Ar file2
217 and writes to the standard output the list of changes necessary to
218 convert one file into the other.
219 No output is produced if the files are identical.
220 .Pp
221 Output options (mutually exclusive):
222 .Bl -tag -width Ds
223 .It Fl C Ar number Fl -context Ar number
224 Like
225 .Fl c
226 but produces a diff with
227 .Ar number
228 lines of context.
229 .It Fl c
230 Produces a diff with 3 lines of context.
231 With
232 .Fl c
233 the output format is modified slightly:
234 the output begins with identification of the files involved and
235 their creation dates and then each change is separated
236 by a line with fifteen
237 .Li * Ns 's .
238 The lines removed from
239 .Ar file1
240 are marked with
241 .Sq \&-\ \& ;
242 those added to
243 .Ar file2
244 are marked
245 .Sq +\ \& .
246 Lines which are changed from one file to the other are marked in
247 both files with
248 .Sq !\ \& .
249 Changes which lie within 3 lines of each other are grouped together on
250 output.
251 .It Fl D Ar string Fl -ifdef Ar string
252 Creates a merged version of
253 .Ar file1
254 and
255 .Ar file2
256 on the standard output, with C preprocessor controls included so that
257 a compilation of the result without defining
258 .Ar string
259 is equivalent to compiling
260 .Ar file1 ,
261 while defining
262 .Ar string
263 will yield
264 .Ar file2 .
265 .It Fl e -ed
266 Produces output in a form suitable as input for the editor utility,
267 .Xr ed 1 ,
268 which can then be used to convert file1 into file2.
269 .Pp
270 Extra commands are added to the output when comparing directories with
271 .Fl e ,
272 so that the result is a
273 .Xr sh 1
274 script for converting text files which are common to the two directories
275 from their state in
276 .Ar dir1
277 to their state in
278 .Ar dir2 .
279 .It Fl f -forward-ed
280 Identical output to that of the
281 .Fl e
282 flag, but in reverse order.
283 It cannot be digested by
284 .Xr ed 1 .
285 .It Fl -help
286 This option prints a summary to stdout and exits with status 0.
287 .It Fl n
288 Produces a script similar to that of
289 .Fl e ,
290 but in the opposite order and with a count of changed lines on each
291 insert or delete command.
292 This is the form used by rcsdiff.
293 .It Fl q -brief
294 Just print a line when the files differ.
295 Does not output a list of changes.
296 .It Fl U Ar number Fl -unified Ar number
297 Like
298 .Fl u
299 but produces a diff with
300 .Ar number
301 lines of context.
302 .It Fl u
303 Produces a
304 .Em unified
305 diff with 3 lines of context.
306 A unified diff is similar to the context diff produced by the
307 .Fl c
308 option.
309 However, unlike with
310 .Fl c ,
311 all lines to be changed (added and/or removed) are present in
312 a single section.
313 .It Fl -version
314 This option prints a version string to stdout and exits with status 0.
315 .It Fl y Fl -side-by-side
316 Output in two columns with a marker between them.
317 The marker can be one
318 of the following:
319 .Pp
320 .Bl -tag -width Ds -offset indent -compact
321 .It space
322 Corresponding lines are identical.
323 .It '|'
324 Corresponding lines are different.
325 .It '<'
326 Files differ and only the first file contains the line.
327 .It '>'
328 Files differ and only the second file contains the line.
329 .El
330 .El
331 .Pp
332 Comparison options:
333 .Bl -tag -width Ds
334 .It Fl a -text
335 Treat all files as ASCII text.
336 Normally
337 .Nm
338 will simply print
339 .Dq Binary files ... differ
340 if files contain binary characters.
341 Use of this option forces
342 .Nm
343 to produce a diff.
344 .It Fl B Fl -ignore-blank-lines
345 Causes chunks that include only blank lines to be ignored.
346 .It Fl b -ignore-space-change
347 Causes trailing blanks (spaces and tabs) to be ignored, and other
348 strings of blanks to compare equal.
349 .It Fl -color= Ns Oo Ar when Oc
350 Color the additions green, and removals red, or the value in the
351 .Ev DIFFCOLORS
352 environment variable.
353 The possible values of
354 .Ar when
355 are
356 .Dq Cm never ,
357 .Dq Cm always
358 and
359 .Dq Cm auto .
360 .Cm auto
361 will use color if the output is a tty and the
362 .Ev COLORTERM
363 environment variable is set to a non-empty string.
364 .It Fl d -minimal
365 Try very hard to produce a diff as small as possible.
366 This may consume a lot of processing power and memory when processing
367 large files with many changes.
368 .It Fl F Ar pattern, Fl -show-function-line Ar pattern
369 Like
370 .Fl p,
371 but display the last line that matches provided pattern.
372 .It Fl I Ar pattern Fl -ignore-matching-lines Ar pattern
373 Ignores changes, insertions, and deletions whose lines match the
374 extended regular expression
375 .Ar pattern .
376 Multiple
377 .Fl I
378 patterns may be specified.
379 All lines in the change must match some pattern for the change to be
380 ignored.
381 See
382 .Xr re_format 7
383 for more information on regular expression patterns.
384 .It Fl i -ignore-case
385 Ignores the case of letters.
386 E.g.,
387 .Dq A
388 will compare equal to
389 .Dq a .
390 .It Fl l -paginate
391 Pass the output through
392 .Xr pr 1
393 to paginate it.
394 .It Fl L Ar label Fl -label Ar label
395 Print
396 .Ar label
397 instead of the first (and second, if this option is specified twice)
398 file name and time in the context or unified diff header.
399 .It Fl p -show-c-function
400 With unified and context diffs, show with each change
401 the first 40 characters of the last line before the context beginning
402 with a letter, an underscore or a dollar sign.
403 For C and Objective-C source code following standard layout conventions, this
404 will show the prototype of the function the change applies to.
405 .It Fl T -initial-tab
406 Print a tab rather than a space before the rest of the line for the
407 normal, context or unified output formats.
408 This makes the alignment of tabs in the line consistent.
409 .It Fl t -expand-tabs
410 Will expand tabs in output lines.
411 Normal or
412 .Fl c
413 output adds character(s) to the front of each line which may screw up
414 the indentation of the original source lines and make the output listing
415 difficult to interpret.
416 This option will preserve the original source's indentation.
417 .It Fl w -ignore-all-blanks
418 Is similar to
419 .Fl b -ignore-space-change
420 but causes whitespace (blanks and tabs) to be totally ignored.
421 E.g.,
422 .Dq if (\ \&a == b \&)
423 will compare equal to
424 .Dq if(a==b) .
425 .It Fl W Ar number Fl -width Ar number
426 Output at most
427 .Ar number
428 columns when using side by side format.
429 The default value is 130.
430 Note that unless
431 .It Fl t
432 was specified,
433 .Nm
434 will always align the second column to a tab stop, so values of
435 .Fl -width
436 smaller than approximately five times the value of
437 .Fl -tabsize
438 may yield surprising results.
439 .It Fl -changed-group-format Ar GFMT
440 Format input groups in the provided
441 .Pp
442 the format is a string with special keywords:
443 .Bl -tag -width %<
444 .It %<
445 lines from FILE1
446 .It %<
447 lines from FILE2
448 .El
449 .It Fl -ignore-file-name-case
450 ignore case when comparing file names
451 .It Fl -no-ignore-file-name-case
452 do not ignore case when comparing file names (default)
453 .It Fl -normal
454 default diff output
455 .It Fl -speed-large-files
456 stub option for compatibility with GNU diff
457 .It Fl -strip-trailing-cr
458 strip carriage return on input files
459 .It Fl -suppress-common-lines
460 Do not output common lines when using the side by side format
461 .It Fl -tabsize Ar number
462 Number of spaces representing a tab (default 8)
463 .El
464 .Pp
465 Directory comparison options:
466 .Bl -tag -width Ds
467 .It Fl N -new-file
468 If a file is found in only one directory, act as if it was found in the
469 other directory too but was of zero size.
470 .It Fl P -unidirectional-new-file
471 If a file is found only in
472 .Ar dir2 ,
473 act as if it was found in
474 .Ar dir1
475 too but was of zero size.
476 .It Fl r -recursive
477 Causes application of
478 .Nm
479 recursively to common subdirectories encountered.
480 .It Fl S Ar name Fl -starting-file Ar name
481 Re-starts a directory
482 .Nm
483 in the middle, beginning with file
484 .Ar name .
485 .It Fl s -report-identical-files
486 Causes
487 .Nm
488 to report files which are the same, which are otherwise not mentioned.
489 .It Fl X Ar file Fl -exclude-from Ar file
490 Exclude files and subdirectories from comparison whose basenames match
491 lines in
492 .Ar file .
493 Multiple
494 .Fl X
495 options may be specified.
496 .It Fl x Ar pattern Fl -exclude Ar pattern
497 Exclude files and subdirectories from comparison whose basenames match
498 .Ar pattern .
499 Patterns are matched using shell-style globbing via
500 .Xr fnmatch 3 .
501 Multiple
502 .Fl x
503 options may be specified.
504 .El
505 .Pp
506 If both arguments are directories,
507 .Nm
508 sorts the contents of the directories by name, and then runs the
509 regular file
510 .Nm
511 algorithm, producing a change list,
512 on text files which are different.
513 Binary files which differ,
514 common subdirectories, and files which appear in only one directory
515 are described as such.
516 In directory mode only regular files and directories are compared.
517 If a non-regular file such as a device special file or FIFO is encountered,
518 a diagnostic message is printed.
519 .Pp
520 If only one of
521 .Ar file1
522 and
523 .Ar file2
524 is a directory,
525 .Nm
526 is applied to the non-directory file and the file contained in
527 the directory file with a filename that is the same as the
528 last component of the non-directory file.
529 .Pp
530 If either
531 .Ar file1
532 or
533 .Ar file2
534 is
535 .Sq - ,
536 the standard input is
537 used in its place.
538 .Ss Output Style
539 The default (without
540 .Fl e ,
541 .Fl c ,
542 or
543 .Fl n -rcs
544 .\" -C
545 options)
546 output contains lines of these forms, where
547 .Va XX , YY , ZZ , QQ
548 are line numbers respective of file order.
549 .Pp
550 .Bl -tag -width "XX,YYcZZ,QQ" -compact
551 .It Li XX Ns Ic a Ns Li YY
552 At (the end of) line
553 .Va XX
554 of
555 .Ar file1 ,
556 append the contents
557 of line
558 .Va YY
559 of
560 .Ar file2
561 to make them equal.
562 .It Li XX Ns Ic a Ns Li YY,ZZ
563 Same as above, but append the range of lines,
564 .Va YY
565 through
566 .Va ZZ
567 of
568 .Ar file2
569 to line
570 .Va XX
571 of file1.
572 .It Li XX Ns Ic d Ns Li YY
573 At line
574 .Va XX
575 delete
576 the line.
577 The value
578 .Va YY
579 tells to which line the change would bring
580 .Ar file1
581 in line with
582 .Ar file2 .
583 .It Li XX,YY Ns Ic d Ns Li ZZ
584 Delete the range of lines
585 .Va XX
586 through
587 .Va YY
588 in
589 .Ar file1 .
590 .It Li XX Ns Ic c Ns Li YY
591 Change the line
592 .Va XX
593 in
594 .Ar file1
595 to the line
596 .Va YY
597 in
598 .Ar file2 .
599 .It Li XX,YY Ns Ic c Ns Li ZZ
600 Replace the range of specified lines with the line
601 .Va ZZ .
602 .It Li XX,YY Ns Ic c Ns Li ZZ,QQ
603 Replace the range
604 .Va XX , Ns Va YY
605 from
606 .Ar file1
607 with the range
608 .Va ZZ , Ns Va QQ
609 from
610 .Ar file2 .
611 .El
612 .Pp
613 These lines resemble
614 .Xr ed 1
615 subcommands to convert
616 .Ar file1
617 into
618 .Ar file2 .
619 The line numbers before the action letters pertain to
620 .Ar file1 ;
621 those after pertain to
622 .Ar file2 .
623 Thus, by exchanging
624 .Ic a
625 for
626 .Ic d
627 and reading the line in reverse order, one can also
628 determine how to convert
629 .Ar file2
630 into
631 .Ar file1 .
632 As in
633 .Xr ed 1 ,
634 identical
635 pairs (where num1 = num2) are abbreviated as a single
636 number.
637 .Sh ENVIRONMENT
638 .Bl -tag -width DIFFCOLORS
639 .It Ev DIFFCOLORS
640 The value of this variable is the form
641 .Ar add Ns : Ns Ar rm ,
642 where
643 .Ar add
644 is the ASCII escape sequence for additions and
645 .Ar rm
646 is the ASCII escape sequence for deletions.
647 If this is unset,
648 .Nm
649 uses green for additions and red for removals.
650 .El
651 .Sh FILES
652 .Bl -tag -width /tmp/diff.XXXXXXXX -compact
653 .It Pa /tmp/diff.XXXXXXXX
654 Temporary file used when comparing a device or the standard input.
655 Note that the temporary file is unlinked as soon as it is created
656 so it will not show up in a directory listing.
657 .El
658 .Sh EXIT STATUS
659 The
660 .Nm
661 utility exits with one of the following values:
662 .Pp
663 .Bl -tag -width Ds -offset indent -compact
664 .It 0
665 No differences were found.
666 .It 1
667 Differences were found.
668 .It >1
669 An error occurred.
670 .El
671 .Pp
672 The
673 .Fl -help
674 and
675 .Fl -version
676 options exit with a status of 0.
677 .Sh EXAMPLES
678 Compare
679 .Pa old_dir
680 and
681 .Pa new_dir
682 recursively generating an unified diff and treating files found only in one
683 of those directories as new files:
684 .Bd -literal -offset indent
685 $ diff -ruN /path/to/old_dir /path/to/new_dir
686 .Ed
687 .Pp
688 Same as above but excluding files matching the expressions
689 .Dq *.h
690 and
691 .Dq *.c :
692 .Bd -literal -offset indent
693 $ diff -ruN -x '*.h' -x '*.c' /path/to/old_dir /path/to/new_dir
694 .Ed
695 .Pp
696 Show a single line indicating if the files differ:
697 .Bd -literal -offset indent
698 $ diff -q /boot/loader.conf /boot/defaults/loader.conf
699 Files /boot/loader.conf and /boot/defaults/loader.conf differ
700 .Ed
701 .Pp
702 Assuming a file named
703 .Pa example.txt
704 with the following contents:
705 .Bd -literal -offset indent
706 FreeBSD is an operating system
707 Linux is a kernel
708 OpenBSD is an operating system
709 .Ed
710 .Pp
711 Compare stdin with
712 .Pa example.txt
713 excluding from the comparison those lines containing either
714 .Qq Linux
715 or
716 .Qq Open :
717 .Bd -literal -offset indent
718 $ echo "FreeBSD is an operating system" | diff -q -I 'Linux|Open' example.txt -
719 .Ed
720 .Sh SEE ALSO
721 .Xr cmp 1 ,
722 .Xr comm 1 ,
723 .Xr diff3 1 ,
724 .Xr ed 1 ,
725 .Xr patch 1 ,
726 .Xr pr 1 ,
727 .Xr sdiff 1
728 .Rs
729 .%A James W. Hunt
730 .%A M. Douglas McIlroy
731 .%T "An Algorithm for Differential File Comparison"
732 .%J Computing Science Technical Report
733 .%Q Bell Laboratories 41
734 .%D June 1976
735 .Re
736 .Sh STANDARDS
737 The
738 .Nm
739 utility is compliant with the
740 .St -p1003.1-2008
741 specification.
742 .Pp
743 The flags
744 .Op Fl aDdIiLlNnPpqSsTtwXxy
745 are extensions to that specification.
746 .Sh HISTORY
747 A
748 .Nm
749 command appeared in
750 .At v6 .