Lines Matching +full:document +full:- +full:file

1 .Dd 2015-03-02
10 file is a newer version of the other file. Or maybe the two files started
15 command to show differences between two files, or each corresponding file
26 normally produces no output; for binary (non-text) files,
36 .Li M-x compare-windows .
46 and can produce a merged file that contains both persons' changes together
63 a copy of the file. If you think of
65 as subtracting one file from another to produce their difference, you can
68 as adding the difference to one file to reproduce the other.
80 Vol. 1 No. 2, 1986, pp. 251--266; and in \(lqA File Comparison Program\(rq, Webb Miller
82 .Em Software---Practice and Experience
83 Vol. 15 No. 11, 1985, pp. 1025--1040. The algorithm was independently discovered
86 Vol. 64, 1985, pp. 100--118. Unless the
87 .Op --minimal
97 Elsevier/MIT Press, 1990, pp. 255--300.
116 from, inserted in, or changed in one file to produce the other file.
142 or whether one file is a prefix of the other.
146 character is added to the beginning of a file. If that file is then compared
147 with an otherwise identical file that lacks the newline at the beginning,
149 will report that a blank line has been added to the file, while
156 to make it easy to inspect two different sets of changes to the same file.
172 For example, suppose the file
178 and the file
192 .Bd -literal -offset indent
207 .Bd -literal -offset indent
210 ---
214 ---
225 .Op -d
227 .Op --minimal
233 .Op -E
235 .Op --ignore-tab-expansion
241 .Op -b
243 .Op --ignore-space-change
252 .Bd -literal -offset indent
253 Here lyeth muche rychnesse in lytell space. -- John Heywood$
254 Here lyeth muche rychnesse in lytell space. -- John Heywood $
258 .Op -w
260 .Op --ignore-all-space
274 .Bd -literal -offset indent
275 Here lyeth muche rychnesse in lytell space.-- John Heywood$
276 He relyeth much erychnes seinly tells pace. --John Heywood ^M$
281 .Op -B
283 .Op --ignore-blank-lines
285 for example, a file containing
286 .Bd -literal -offset indent
290 -- Euclid, The Elements, I
292 is considered identical to a file containing
293 .Bd -literal -offset indent
298 -- Euclid, The Elements, I
303 .Op -b
305 .Op --ignore-space-change
307 .Op -w
309 .Op --ignore-all-space
312 .Op -B
314 .Li -I '^$'
316 .Op -I '^[[:space:]]*$'
318 .Op -b
320 .Op -w
327 .Op -I Va regexp
329 .Op --ignore-matching-lines= Va regexp
332 .Li diff -I '^[[:digit:]]'
336 .Op -I
338 if every changed line in the hunk---every insertion and every deletion---matches
346 .Op -I
361 .Op -i
363 .Op --ignore-case
372 .Op -q
374 .Op --brief
389 that one file is a prefix of the other. You can use the
390 .Op -s ,
391 .Op --quiet ,
393 .Op --silent
408 thinks that either of the two files it is comparing is binary (a non-text
409 file), it normally treats that pair of files much as if the summary output
416 determines whether a file is text or binary by checking the first few bytes
417 in the file; the exact number of bytes is system dependent, but it is typically
418 several thousand. If every byte in that part of the file is non-null,
420 considers the file to be text; otherwise it considers the file to be binary.
427 would erroneously decide that those are non-text files. Or you might be comparing
433 .Op -a
435 .Op --text
445 .Op -q
447 .Op --brief
455 .Op -a
457 .Op --text
459 .Op -q
461 .Op --brief
469 .Op --binary
472 to read and write binary data instead. This option has no effect on a POSIX-compliant
479 .Op --binary
484 when dealing with non-text files that are meant to be interchanged with POSIX-compliant
488 .Op --strip-trailing-cr
500 .Op -l
502 .Op --verbose
506 .Op -b
508 .Op --print-bytes
515 thinks that any of the files it is comparing is binary (a non-text file),
520 to decide whether a file is binary. As with
522 if the input files contain a few non-text bytes but otherwise are like text
527 .Op -a
529 .Op --text
545 This is the file
548 .Bd -literal -offset indent
553 Therefore let there always be non-being,
562 This is the file
565 .Bd -literal -offset indent
569 Therefore let there always be non-being,
603 It can optionally show in which function or section of the file the differing
630 .Op -C Va lines ,
631 .Op --context[= Va lines] ,
633 .Op -c
646 .Li diff -c lao tzu
654 .Bd -literal -offset indent
655 *** lao 2002-02-21 23:30:39.942229878 -0800
656 --- tzu 2002-02-21 23:30:50.442260588 -0800
659 - The Way that can be told of is not the eternal Way;
660 - The name that can be named is not the eternal name.
663 Therefore let there always be non-being,
666 --- 1,6 ----
670 Therefore let there always be non-being,
675 --- 8,13 ----
687 .Li diff -C 1 lao tzu
693 .Bd -literal -offset indent
694 *** lao 2002-02-21 23:30:39.942229878 -0800
695 --- tzu 2002-02-21 23:30:50.442260588 -0800
698 - The Way that can be told of is not the eternal Way;
699 - The name that can be named is not the eternal name.
702 Therefore let there always be non-being,
703 --- 1,4 ----
707 Therefore let there always be non-being,
710 --- 10,13 ----
719 The context output format starts with a two-line header, which looks like
722 .Bd -literal -offset indent
723 *** from-file from-file-modification-time
724 --- to-file to-file-modification time
728 .Li 2002-02-21 23:30:39.942229878 -0800
730 .Lk ftp://ftp.isi.edu/in-notes/rfc2822.txt .
742 .Op --label= Va label
748 .Bd -literal -offset indent
750 *** from-file-line-numbers ****
751 from-file-line
752 from-file-line...
753 --- to-file-line-numbers ----
754 to-file-line
755 to-file-line...
767 .Bl -tag -width Ds
772 in the part of this hunk for the other file.
775 An \(lqinserted\(rq line in the second file that corresponds to nothing in the first
776 file.
778 .It -
779 A \(lqdeleted\(rq line in the first file that corresponds to nothing in the second
780 file.
784 .Va from-file
786 .Va to-file
794 .Op -U Va lines ,
795 .Op --unified[= Va lines] ,
797 .Op -u
814 .Li diff -u lao tzu
819 .Bd -literal -offset indent
820 --- lao 2002-02-21 23:30:39.942229878 -0800
821 +++ tzu 2002-02-21 23:30:50.442260588 -0800
822 @@ -1,7 +1,6 @@
829 Therefore let there always be non-being,
832 @@ -9,3 +8,6 @@
843 The unified output format starts with a two-line header, which looks like
846 .Bd -literal -offset indent
847 --- from-file from-file-modification-time
848 +++ to-file to-file-modification-time
852 .Li 2002-02-21 23:30:39.942229878 -0800
857 .Op --label= Va label
864 .Bd -literal -offset indent
865 @@ from-file-line-numbers to-file-line-numbers @@
866 line-from-either-file
867 line-from-either-file...
885 .Bl -tag -width Ds
887 A line was added here to the first file.
889 .It -
890 A line was removed here from the first file.
908 .Op -F Va regexp
910 .Op --show-function-line= Va regexp
917 to be the beginning of a section of the file. Here are suggested regular expressions
920 .Bl -tag -width Ds
937 .Op -F
939 .Op --show-function-line
951 .Op -p
953 .Op -F
960 .Op -p
962 .Op --show-c-function
967 .Op -C Va lines
970 .Op -U Va lines
974 .Op -p
976 .Op --show-c-function
978 .Op -F '^[[:alpha:]$_]'
980 .Op -c -F '^[[:alpha:]$_]'
987 .Em Showing Alternate File Names
994 .Op --label= Va label
996 and date of the first file in the header; the second time, its argument replaces
997 the name and date of the second file. If you give this option more than twice,
1000 .Op --label
1001 option does not affect the file names in the
1004 .Op -l
1006 .Op --paginate
1011 .Li diff -C 2 --label=original --label=modified lao tzu :
1013 .Bd -literal -offset indent
1015 --- modified
1024 .Bl -tag -width Ds
1028 .Op --ignore
1037 The files differ and only the first file contains the line.
1040 The files differ and only the second file contains the line.
1043 Only the first file contains the line, but the difference is ignored.
1046 Only the second file contains the line, but the difference is ignored.
1081 .Op -y
1083 .Op --side-by-side
1088 .Op -W Va columns
1090 .Op --width= Va columns
1097 .Op --left-column
1099 .Op --suppress-common-lines
1105 .Li diff -y -W 72 lao tzu
1110 .Bd -literal -offset indent
1144 .Op --normal
1156 .Bd -literal -offset indent
1162 ---
1177 .Bd -literal -offset indent
1178 change-command
1179 < from-file-line
1180 < from-file-line...
1181 ---
1182 > to-file-line
1183 > to-file-line...
1187 comma-separated range of lines in the first file, a single character indicating
1188 the kind of change to make, and a line number or comma-separated range of
1189 lines in the second file. All line numbers are the original line numbers in
1190 each file. The types of change commands are:
1192 .Bl -tag -width Ds
1196 of the second file after line
1198 of the first file. For example,
1200 means append lines 12--15 of file 2 after line 8 of file 1; or, if changing
1201 file 2 into file 1, delete lines 12--15 of file 2.
1206 of the first file with lines in range
1208 of the second file. This is like a combined add and delete, but more compact.
1211 means change lines 5--7 of file 1 to read as lines 8--10 of file 2; or, if
1212 changing file 2 into file 1, change lines 8--10 of file 2 to read as lines
1213 5--7 of file 1.
1218 from the first file; line
1220 is where they would have appeared in the second file had they not been deleted.
1223 means delete lines 5--7 of file 1; or, if changing file 2 into file 1, append
1224 lines 5--7 of file 1 after line 3 of file 2.
1229 .Va from-file
1231 .Va to-file .
1238 text editor to change the first file into the second file. Long ago, this
1239 was the only output mode that was suitable for editing one file into another
1243 .Op -e
1245 .Op --ed
1252 produce the first file if all you have is the second file and the diff).
1254 If the file
1257 .Li diff -e old new ,
1259 .Li (cat d && echo w) | ed - old
1270 .Li diff -e old new1 ,
1271 .Li diff -e new1 new2 ,
1273 .Li diff -e newN-1 newN ,
1275 .Li (cat d1 d2 ... dN && echo w) | ed - old
1284 .Li diff -e lao tzu
1289 .Bd -literal -offset indent
1314 .Bd -literal -offset indent
1315 change-command
1316 to-file-line
1317 to-file-line...
1330 format cannot represent an incomplete line, so if the second file ends in
1336 comma-separated range of lines in the first file and a single character indicating
1338 in the file. The types of change commands are:
1340 .Bl -tag -width Ds
1342 Add text from the second file after line
1344 in the first file. For example,
1346 means to add the following lines after line 8 of file 1.
1351 in the first file with the following lines. Like a combined add and delete,
1354 means change lines 5--7 of file 1 to read as the text file 2.
1359 from the first file. For example,
1361 means delete lines 5--7 of file 1.
1388 .Op -f
1390 .Op --forward-ed
1398 .Op -n
1400 .Op --rcs
1405 but it can represent arbitrary changes to the contents of a file because it
1417 Also, if the second file ends in a changed incomplete line, then the output
1421 .Li diff -n lao tzu
1426 .Bd -literal -offset indent
1438 .Ss Merging Files with If-then-else
1459 .Op -D Va name
1461 .Op --ifdef= Va name
1473 .Li waitpid (-1, &s, 0)
1475 .Op --ifdef=HAVE_WAITPID
1478 .Bd -literal -offset indent
1483 if ((w = waitpid (-1, &s, 0)) < 0 && errno != EINTR)
1495 that allow if-then-else input, including programming languages and text formatting
1503 and outputs a merged file in which old regions are surrounded by
1505 -
1509 -
1513 .Bd -literal -offset indent
1515 --old-group-format='\ebegin{em}
1518 --new-group-format='\ebegin{bf}
1527 .Bd -literal -offset indent
1529 --old-group-format='\ebegin{em}
1532 --new-group-format='\ebegin{bf}
1535 --unchanged-group-format='%=' \e
1536 --changed-group-format='\ebegin{em}
1547 .Bd -literal -offset indent
1549 --unchanged-group-format=\(rq \e
1550 --old-group-format='-------- %dn line%(n=1?:s) deleted at %df:
1552 --new-group-format='-------- %dN line%(N=1?:s) added after %de:
1554 --changed-group-format='-------- %dn line%(n=1?:s) changed at %df:
1555 %<-------- to:
1567 .Bl -tag -width Ds
1568 .It --old-group-format= Va format
1569 These line groups are hunks containing only lines from the first file. The
1571 specified; otherwise it is a format that outputs the line group as-is.
1573 .It --new-group-format= Va format
1574 These line groups are hunks containing only lines from the second file. The
1576 otherwise it is a format that outputs the line group as-is.
1578 .It --changed-group-format= Va format
1582 .It --unchanged-group-format= Va format
1584 group format is a format that outputs the line group as-is.
1592 .Bl -tag -width Ds
1594 stands for the lines from the first file, including the trailing newline.
1599 stands for the lines from the second file, including the trailing newline.
1618 stands for a colon, even inside the then-part of an if-then-else format, which
1643 .Bl -tag -width Ds
1645 The line number of the line just before the group in the old file.
1648 The line number of the first line in the group in the old file; equals
1653 The line number of the last line in the group in the old file.
1656 The line number of the line just after the group in the old file; equals
1661 The number of lines in the group in the old file; equals
1663 -
1668 Likewise, for lines in the new file.
1685 .Li -
1686 for left-justification,
1728 (the number of lines in the group in the new file) is 0, to
1739 Line formats control how each line taken from an input file is output as part
1740 of a line group in if-then-else format.
1742 For example, the following command outputs text with a one-character change
1744 .Li -
1750 .Bd -literal -offset indent
1752 --old-line-format='-%l
1754 --new-line-format='|%l
1756 --unchanged-line-format=' %l
1765 .Bl -tag -width Ds
1766 .It --old-line-format= Va format
1767 formats lines just from the first file.
1769 .It --new-line-format= Va format
1770 formats lines just from the second file.
1772 .It --unchanged-line-format= Va format
1775 .It --line-format= Va format
1784 .Bl -tag -width Ds
1849 .Op -t
1851 .Op --expand-tabs
1861 .Bd -literal -offset indent
1863 --old-line-format='< %l
1865 --new-line-format='> %l
1867 --old-group-format='%df%(f=l?:,%dl)d%dE
1869 --new-group-format='%dea%dF%(F=L?:,%dL)
1871 --changed-group-format='%df%(f=l?:,%dl)c%dF%(F=L?:,%dL)
1872 %<---
1874 --unchanged-group-format=\(rq \e
1878 .Em An Example of If-then-else Format
1881 .Li diff -DTWO lao tzu
1886 .Bd -literal -offset indent
1898 Therefore let there always be non-being,
1912 .Em Detailed Description of If-then-else Format
1917 merged output format, if the hunk contains only lines from the first file,
1920 file,
1927 from the first file, lines from the second file, and lines common to both
1931 .Op --ifdef= Va name
1934 .Bd -literal -offset indent
1935 --old-group-format='#ifndef name
1938 --new-group-format='#ifdef name
1941 --unchanged-group-format='%=' \e
1942 --changed-group-format='#ifndef name
1951 .Op -D Va name
1953 .Op --ifdef= Va name
1970 .Op -D Va name
1973 .Op -D Va name
1974 option, except it operates on a file and a diff to produce a merged file;See Section
1978 When an input file ends in a non-newline character, its last line is called
1992 outputs the incomplete line as-is, without any trailing newline or following
1993 line. The side by side format normally represents incomplete lines as-is,
2000 The if-then-else line format preserves a line's incompleteness with
2020 are one-byte files that contain just
2028 .Bd -literal -offset indent
2031 \e No newline at end of file
2032 ---
2034 \e No newline at end of file
2037 (The exact message may differ in non-English locales.)
2038 .Li diff -n F G
2041 .Bd -literal -offset indent
2047 .Li diff -e F G
2050 .Bd -literal -offset indent
2059 to compare some or all of the files in two directory trees. When both file
2062 are directories, it compares each file that is contained in both directories,
2063 examining file names in alphabetical order as specified by the
2069 .Op -s
2071 .Op --report-identical-files
2076 .Op -r
2078 .Op --recursive
2082 For file names that are in only one of the directories,
2084 normally does not show the contents of the file that exists; it reports only
2085 that the file exists in that directory and not in the other. You can make
2087 act as though the file existed but was empty in the other directory, so that
2088 it outputs the entire contents of the file that actually exists. (It is output
2091 .Op -N
2093 .Op --new-file
2098 .Op --unidirectional-new-file
2100 .Op -N .
2102 .Op -N
2111 .Op -x Va pattern
2113 .Op --exclude= Va pattern
2117 Unlike in the shell, a period at the start of the base of a file name matches
2121 .Op -x '*.[ao]'
2122 ignores any file whose name ends with
2129 .Op -x 'RCS' -x '*,v'
2130 ignores any file or subdirectory whose base name is
2136 in a file, one pattern per line, and use the
2137 .Op -X Va file
2139 .Op --exclude-from= Va file
2140 option. Trailing white space and empty lines are ignored in the pattern file.
2144 .Op -S Va file
2146 .Op --starting-file= Va file
2147 option. This compares only the file
2148 .Va file
2151 If two directories differ only in that file names are lower case in one directory
2154 normally reports many differences because it compares file names in a case
2156 .Op --ignore-file-name-case
2159 ignores case differences in file names, so that for example the contents of
2160 the file
2162 in one directory are compared to the contents of the file
2165 .Op --no-ignore-file-name-case
2167 .Op --ignore-file-name-case
2171 .Op -x Va pattern
2173 .Op --exclude= Va pattern
2175 .Op -X Va file
2177 .Op --exclude-from= Va file
2179 .Op --ignore-file-name-case
2180 option is in effect, case is ignored when excluding file names matching the
2196 provides two ways to make tab-aligned columns line up correctly.
2202 .Op -t
2204 .Op --expand-tabs
2210 .Op -l
2212 .Op --ignore-white-space
2219 .Op --tabsize= Va columns
2230 .Op -T
2232 .Op --initial-tab
2236 It can be convenient to have long output page-numbered and time-stamped. The
2237 .Op -l
2239 .Op --paginate
2245 .Li diff -lc lao tzu :
2247 .Bd -literal -offset indent
2248 2002-02-22 14:20 diff -lc lao tzu Page 1
2262 normally does not need to read two hard or symbolic links to the same file,
2265 .Li diff -r
2266 to compare the original to the copy. If the original files are read-only,
2269 .Li cp -lR
2271 .Li cp -sR ) .
2272 Before editing a file in the copy for the first time, you should break the
2284 determines which lines have changed always comes up with a near-minimal set
2291 .Op -d
2293 .Op --minimal
2300 .Op --speed-large-files
2314 run faster, but occasionally it may produce non-minimal output. The
2315 .Op --horizon-lines= Va lines
2333 shifts a hunk's lines towards the end of the file. Merging hunks can make
2346 Hunks are labeled depending on whether they are two-way or three-way, and
2353 .Ss A Third Sample Input File
2354 Here is a third sample file that will be used in examples to illustrate the
2362 This is the third sample file, called
2365 .Bd -literal -offset indent
2371 Therefore let there always be non-being,
2379 -- The Way of Lao-Tzu, tr. Wing-tsit Chan
2390 .Bd -literal -offset indent
2418 -- The Way of Lao-Tzu, tr. Wing-tsit Chan
2424 Three-way hunks have plain
2426 lines, and two-way hunks have
2437 .Op -T
2439 .Op --initial-tab
2448 .Bl -tag -width Ds
2449 .It Va file: Va la
2452 of file
2453 .Va file ,
2454 and contains no lines in that file. To edit this file to yield the other files,
2457 means that the hunk follows line 11 in the first file and contains no lines
2458 from that file.
2460 .It Va file: Va rc
2463 of file
2464 .Va file .
2467 is a comma-separated pair of line numbers, or just one number if the range
2468 is a singleton. To edit this file to yield the other files, one must change
2471 means that the hunk contains lines 11 through 13 from the second file.
2490 .Em three-way hunk
2492 .Em two-way hunk .
2504 hunks by merging the two-way hunks output by the two commands
2531 .Bd -literal -offset indent
2547 because it found a two-way hunk containing
2551 in the second file, then the single line
2553 common to all three files, then a three-way hunk containing the last line
2554 of each file.
2557 When two people have made changes to copies of the same file,
2569 to merge three or more sets of changes to a file by merging two change sets
2578 .Bd -literal -offset indent
2597 This merging is well-defined as long as
2620 script that that can be applied to the first file to yield the merged output.
2634 .Op -e
2636 .Op --ed
2638 .Op -3
2640 .Op --easy-only ,
2642 .Op -x
2644 .Op --overlap-only .
2647 .Op -e ,
2648 .Op -3
2650 .Op -x
2667 .Op -A
2669 .Op --show-all
2678 .Op -e
2680 .Op -3
2682 .Op -x .
2685 .Li diff3 -e lao tzu tao :
2686 .Bd -literal -offset indent
2689 -- The Way of Lao-Tzu, tr. Wing-tsit Chan
2697 .Li diff3 -3 lao tzu tao :
2698 .Bd -literal -offset indent
2705 .Li diff3 -x lao tzu tao :
2706 .Bd -literal -offset indent
2709 -- The Way of Lao-Tzu, tr. Wing-tsit Chan
2722 .Bd -literal -offset indent
2737 .Bd -literal -offset indent
2748 .Op -A
2750 .Op --show-all
2752 .Op -e
2759 .Li diff3 -A lao tzu tao
2764 .Bd -literal -offset indent
2772 And it outputs the three-way conflict as follows:
2774 .Bd -literal -offset indent
2782 -- The Way of Lao-Tzu, tr. Wing-tsit Chan
2787 .Op -E
2789 .Op --show-overlap
2791 .Op -A
2793 .Op --show-all
2795 contents of the second file. Thus the
2796 .Op -E
2798 .Op -e
2799 option, except that it brackets the first and third files from three-way overlapping
2801 .Op -X
2803 .Op -x ,
2805 for the three-way overlapping change above, the
2806 .Op -E
2808 .Op -X
2811 .Bd -literal -offset indent
2815 -- The Way of Lao-Tzu, tr. Wing-tsit Chan
2821 .Op --label= Va label
2828 file. Thus
2829 .Li diff3 -A --label X --label Y --label Z A B C
2831 .Li diff3 -A A B C ,
2845 .Op -m
2847 .Op --merge
2850 outputs the merged file directly. This is more efficient than using
2852 to generate it, and works even with non-text files that
2855 .Op -m
2859 .Op -A
2863 .Li diff3 -m lao tzu tao
2868 .Bd -literal -offset indent
2876 Therefore let there always be non-being,
2890 -- The Way of Lao-Tzu, tr. Wing-tsit Chan
2896 .Op -m ,
2909 .Op -m ,
2916 .Ss Saving the Changed File
2932 .Op -i
2942 .Op -i
2946 .Op -AeExX3 ,
2948 .Op -m .
2953 you can merge two files interactively based on a side-by-side
2954 .Op -y
2958 .Op -o Va file
2960 .Op --output= Va file
2979 .Bd -literal -offset indent
2980 -a -b -d -i -t -v
2981 -B -E -I regexp
2983 --expand-tabs
2984 --ignore-blank-lines --ignore-case
2985 --ignore-matching-lines=regexp --ignore-space-change
2986 --ignore-tab-expansion
2987 --left-column --minimal --speed-large-files
2988 --strip-trailing-cr --suppress-common-lines
2989 --tabsize=columns --text --version --width=columns
2995 .Op -l
2997 .Op --left-column
2999 .Op -s
3001 .Op --suppress-common-lines .
3004 .Op -w
3006 .Op -W
3011 .Op -w Va columns
3013 .Op --width= Va columns ,
3015 .Op -W
3017 .Op --ignore-all-space .
3020 .Op -o
3024 .Op -y
3026 .Op --side-by-side
3031 Groups of common lines, with a blank gutter, are copied from the first file
3039 .Bl -tag -width Ds
3041 Discard both versions. Invoke a text editor on an empty temporary file, then
3042 copy the resulting file to the output.
3045 Concatenate the two versions, edit the result in a temporary file, then copy
3051 except precede each version with a header that shows what file and lines the
3082 environment variable if it is set. The default is system-dependent.
3088 and applies the differences to a copy of the original file, producing a patched
3092 the entire file set; your correspondents can apply
3097 and uses the headers to determine which file to patch. This lets your correspondents
3105 file to ensure that your correspondents apply diffs in the proper order.
3109 that specify which file to patch. It applies
3113 one by one. If a hunk does not exactly match the original file,
3115 uses heuristics to try to patch the file as well as it can. If no approximate
3120 normally replaces each file
3133 format the patch file uses by examining its contents. For patch files that
3137 to interpret the patch file as a certain format of diff. The output formats
3142 .Bl -tag -width Ds
3143 .It -c
3144 .It --context
3147 .It -e
3148 .It --ed
3152 .It -n
3153 .It --normal
3156 .It -u
3157 .It --unified
3162 If a nonexistent input file is under a revision control system supported by
3165 normally asks the user whether to get (or check out) the file from the revision
3169 also asks when the input file is read-only and matches the default version
3173 .Op -g Va num
3175 .Op --get= Va num
3180 gets the file without asking the user; if zero,
3182 neither asks the user nor gets the file; and if negative,
3184 asks the user before getting the file. The default value of
3200 tries to skip any leading text in the patch file, apply the diff, and then
3211 .Li -
3213 .Li -
3215 .Lk ftp://ftp.isi.edu/in-notes/rfc934.txt ,
3225 vice versa. If this happens to a patch file or an input file, the files might
3229 .Op -l
3231 .Op --ignore-white-space
3235 sequence of blanks in the patch file matches any nonempty sequence of blanks
3236 in the input files. Non-blank characters must still match exactly. Each line
3237 of the context must still match a line in the input file.
3243 with the new file first instead of second. This creates a diff that is \(lqreversed\(rq.
3247 .Op -R
3249 .Op --reverse
3262 .Op -R
3275 thinks it is a reversed patch and offers to un-apply the patch. This could
3277 to un-apply the patch, just answer
3279 to this offer and to the subsequent \(lqapply anyway\(rq question---or type
3280 .Li C-c
3310 .Op -F Va lines
3312 .Op --fuzz= Va lines
3325 to a reject file (see Section
3332 in the reject file may be different from those in the patch file: they show
3335 thinks the failed hunks belong in the new file rather than in the old one.
3338 .Op --verbose
3342 line (in the new file)
3365 A patch against an empty file applies to a nonexistent file, and vice versa.See Section
3371 copy of the file that the patch was generated from.
3381 .Op --dry-run
3394 .Op --dry-run
3398 Sometimes when comparing two directories, a file may exist in one directory
3402 .Op -N
3404 .Op --new-file
3405 option, or if you supply an old or new file that is named
3407 or is empty and is dated the Epoch (1970-01-01 00:00:00 UTC),
3409 outputs a patch that adds or deletes the contents of this file. When given
3412 normally creates a new file or removes the old file. However, when conforming
3416 does not remove the old file, but leaves it empty. The
3417 .Op -E
3419 .Op --remove-empty-files
3423 patch does not appear to be one that removed the file.
3425 If the patch appears to create a file that already exists,
3432 updates a file, it normally sets the file's last-modified time stamp to the
3437 to incorrectly conclude that a patched file is out of date. For example, if
3454 .Op -Z
3456 .Op --set-utc
3459 to set a patched file's modification and access times to the time stamps given
3465 .Op -T
3467 .Op --set-time
3469 .Op -Z
3471 .Op --set-utc ,
3475 local time stamps are ambiguous when local clocks move backwards during daylight-saving
3478 .Op -Z
3480 .Op --set-utc .
3483 normally refrains from setting a file's time stamps if the file's original
3484 last-modified time stamp does not match the time given in the diff header,
3485 of if the file's contents do not exactly match the patch. However, if the
3486 .Op -f
3488 .Op --force
3489 option is given, the file's time stamps are set regardless.
3496 you set file time stamps to values other than the current time of day, you
3503 .Ss Multiple Patches in a File
3504 If the patch file contains more than one patch, and if you do not specify
3505 an input file on the command line,
3508 means that it determines the name of the file to patch for each patch, and
3509 that it examines the leading text before each patch for file names and prerequisite
3515 uses the following rules to intuit a file name from the leading text before
3518 takes an ordered list of candidate file names as follows:
3520 .Bl -bullet
3524 takes the old and new file names in the header. A name is ignored if it does
3526 .Op -p Va num
3528 .Op --strip= Va num
3546 For the purpose of the following rules, the candidate file names are considered
3553 selects a file name from the candidate list as follows:
3555 .Bl -bullet
3568 selects the first named file with an RCS, ClearCase, or SCCS master.
3574 is not conforming to POSIX, and the patch appears to create a file,
3579 If no file name results from the above heuristics, you are asked for the name
3580 of the file to patch, and
3587 of a nonempty list of file names,
3600 .Op -d Va directory
3602 .Op --directory= Va directory
3607 the current directory for interpreting both file names in the patch file,
3608 and file names given as arguments to other options (such as
3609 .Op -B
3611 .Op -o ) .
3612 For example, while in a mail reading program, you can patch a file in the
3616 .Bd -literal -offset indent
3617 | patch -d /usr/src/emacs
3620 Sometimes the file names given in a patch contain leading directories, but
3623 .Op -p Va number
3625 .Op --strip= Va number
3626 option to set the file name strip count to
3631 the front of file names. A sequence of one or more adjacent slashes is counted
3634 strips off all leading directories, leaving just the base file names.
3636 For example, suppose the file name in the patch file is
3639 .Op -p0
3640 gives the entire file name unmodified,
3641 .Op -p1
3645 .Op -p4
3649 .Op -p
3654 looks for each file (after any slashes have been stripped) in the current
3656 .Op -d Va directory
3662 creates a backup file if the patch does not exactly match the original input
3663 file, because in that case the original data might not be recovered if you
3665 .Li patch -R
3674 .Op -b
3676 .Op --backup
3679 to make a backup file regardless of whether the patch matches the original
3681 .Op --backup-if-mismatch
3686 .Op --no-backup-if-mismatch
3692 When backing up a file that does not exist, an empty, unreadable backup file
3693 is created as a placeholder to represent the nonexistent file.
3695 .Ss Backup File Names
3698 renames an original input file into a backup file by appending to its name
3705 would make the backup file name too long. The
3706 .Op -z Va backup-suffix
3708 .Op --suffix= Va backup-suffix
3712 .Va backup-suffix
3721 instead of having a single backup of each file,
3723 makes a new backup file name each time it patches a file. For example, the
3724 backups of a file named
3733 .Op -V Va backup-style
3735 .Op --version-control= Va backup-style
3736 option takes as an argument a method for creating backup file names. You can
3742 .Op -V
3748 control backup file names; they do not affect the choice of revision control
3753 .Op -V
3755 .Li version-control
3762 .Bl -tag -width Ds
3779 to prepend a prefix, such as a directory name, to produce backup file names.
3781 .Op -B Va prefix
3783 .Op --prefix= Va prefix
3787 .Op -Y Va prefix
3789 .Op --basename-prefix= Va prefix
3792 to the last file name component of backup file names instead; for example,
3793 .Op -Y ~
3795 .Pa dir/file.c
3797 .Pa dir/~file.c .
3798 If you use either of these prefix options, the suffix-based options are ignored.
3800 If you specify the output file with the
3801 .Op -o
3802 option, that file is the one that is backed up, not the input file.
3806 .Op --no-backup-if-mismatch
3810 .Ss Reject File Names
3813 could not find a place to apply) are normally the name of the output file
3820 would make the backup file name too long).
3824 to place all of the rejected patches in a single file. The
3825 .Op -r Va reject-file
3827 .Op --reject-file= Va reject-file
3829 .Va reject-file
3830 as the reject file name.
3839 and to affect the way that file names are quoted in messages.
3845 a later patch to a partially patched file.
3852 .Op --verbose
3857 is reading text in the patch file, attempting to determine whether there is
3863 .Op -s ,
3864 .Op --quiet ,
3866 .Op --silent
3874 .Op -f
3876 .Op --force
3881 .Bl -bullet
3883 Skip patches that do not contain file names in their headers.
3895 .Op -t
3897 .Op --batch
3899 .Op -f ,
3902 .Bl -bullet
3904 Skip patches that do not contain file names in their headers (the same as
3905 .Op -f ) .
3908 Skip patches for which the file has the wrong version for the
3920 outputs a file name in a diagnostic message, it can format the name in any
3921 of several ways. This can be useful to output file names unambiguously, even
3923 .Op --quoting-style= Va word
3928 .Bl -tag -width Ds
3930 Output names as-is.
3934 .It shell-always
3941 except omit the surrounding double-quote characters.
3945 .Op --quoting-style
3955 .Op --posix
3962 .Bl -bullet
3964 Take the first existing file from the list (old, new, index) when intuiting
3965 file names from diff headers.See Section
4000 .Bl -bullet
4005 .Op -p
4007 .Op -p
4009 .Op -p0 .
4011 .Op -p
4013 .Op -p 0
4015 .Op -p0 .
4017 .Op -p0
4019 .Op -p1 .
4029 in file names.
4035 .Op -b
4037 .Op --backup
4045 .Op --no-backup-if-mismatch
4049 .Op -b Va suffix
4053 .Li -b -z Va suffix
4061 of the file to be patched from the patch header. This method did not conform
4065 is optionally POSIX-conforming; we hope it has fewer gotchas. The two methods
4066 are compatible if the file names in the context diff header and the
4068 line are all identical after prefix-stripping. Your patch is normally compatible
4069 if each header's file names all contain the same number of slashes.
4075 for an answer from the first file in the following list that was a terminal:
4105 .Bd -literal -offset indent
4123 subject, instead of one large, harder-to-digest patch that covers all the
4137 .Li diff -Naur Va old Va new
4147 .Op -N
4149 .Op -a
4150 lets the patch update non-text files;
4151 .Op -u
4153 .Op -r
4157 .Bd -literal -offset indent
4158 diff -Naur gcc-3.0.3 gcc-3.0.4
4165 .Li -p1
4191 .Op -p Va number
4193 file names have different numbers of slashes. For example, do not send a patch
4196 .Bd -literal -offset indent
4197 diff -Naur v2.0.29/prog/README prog/README
4198 --- v2.0.29/prog/README 2002-03-10 23:30:39.942229878 -0800
4199 +++ prog/README 2002-03-17 20:49:32.442260588 -0800
4202 because the two file names have different numbers of slashes, and different
4205 interpret the file names differently. To avoid confusion, send output that
4208 .Bd -literal -offset indent
4209 diff -Naur v2.0.29/prog/README v2.0.30/prog/README
4210 --- v2.0.29/prog/README 2002-03-10 23:30:39.942229878 -0800
4211 +++ v2.0.30/prog/README 2002-03-17 20:49:32.442260588 -0800
4214 Make sure you have specified the file names correctly, either in a context
4220 Avoid sending patches that compare backup file names like
4226 into patching a backup file instead of the real file. Instead, send patches
4227 that compare the same base file names in different directories, e.g.
4233 have gone before it, you can make the first patch in the patch file update
4234 a file with a name like
4238 which contains a patch level or version number. If the input file contains
4245 line before the patch. If the leading text in the patch file contains a line
4250 whether the next input file contains that word, preceded and followed by either
4258 .Li diff -Naur
4281 .Op -x Va pattern
4284 If you want your patch to modify a derived file because your recipients lack
4285 tools to build it, make sure that the patch for the derived file follows any
4291 .Li diff -Naur .
4311 number where they differ or reports that one file is a prefix of the other.
4316 .Bd -literal -offset indent
4317 cmp options... from-file [to-file [from-skip [to-skip]]]
4320 The file name
4321 .Pa -
4324 also uses the standard input if one file name is omitted. The
4325 .Va from-skip
4327 .Va to-skip
4328 operands specify how many bytes to ignore at the start of each file; they
4330 .Op --ignore-initial= Va from-skip: Va to-skip
4335 outputs nothing if the two files have the same contents. If one file is a
4340 .Bd -literal -offset indent
4341 cmp: EOF on shorter-file
4348 .Bd -literal -offset indent
4349 from-file to-file differ: char byte-number, line line-number
4363 .Li - ,
4365 .Li -- .
4368 .Op -bl
4370 .Op -b -l .
4372 .Bl -tag -width Ds
4373 .It -b
4374 .It --print-bytes
4379 .Li M-
4382 .It --help
4385 .It -i Va skip
4386 .It --ignore-initial= Va skip
4394 .Op Va from-skip: Va to-skip ,
4396 .Va from-skip
4397 bytes of the first input file and the first
4398 .Va to-skip
4401 .It -l
4402 .It --verbose
4406 .It -n Va count
4407 .It --bytes= Va count
4412 .It -s
4413 .It --quiet
4414 .It --silent
4418 .It -v
4419 .It --version
4437 .Op -n 4M
4439 .Op -n 4MiB
4441 .Op -n 4194304 ,
4443 .Op -n 4MB
4445 .Op -n 4000000 .
4447 .Lk http://www.bipm.fr/enus/3_SI/si-prefixes.html
4455 .Bl -tag -width Ds
4465 and the IEC 60027-2 prefix is
4502 is a GNU extension to IEC 60027-2.)
4509 is a GNU extension to IEC 60027-2.)
4517 .Bd -literal -offset indent
4521 In the simplest case, two file names
4522 .Va from-file
4524 .Va to-file
4528 .Va from-file
4530 .Va to-file .
4531 A file name of
4532 .Pa -
4534 .Li diff - -
4537 If one file is a directory and the other is not,
4539 compares the file in the directory whose name is that of the non-directory.
4540 The non-directory file must not be
4541 .Pa - .
4543 If two file names are given and both are directories,
4547 .Op -r
4549 .Op --recursive
4552 never compares the actual contents of a directory as if it were a file. The
4553 file that is fully specified may not be standard input, because standard input
4557 .Op --from-file= Va file
4558 option is given, the number of file names is arbitrary, and
4559 .Va file
4560 is compared to each named file. Similarly, if the
4561 .Op --to-file= Va file
4562 option is given, each named file is compared to
4563 .Va file .
4567 .Li - ,
4568 so normally file names may not begin with
4569 .Li - .
4571 .Op --
4572 as an argument by itself treats the remaining arguments as file names even
4574 .Li - .
4579 .Op -a
4581 .Op --text
4583 .Op -q
4585 .Op --brief
4593 .Li - ,
4595 .Li -- .
4598 .Op -ac
4600 .Op -a -c .
4604 .Bl -tag -width Ds
4605 .It -a
4606 .It --text
4607 Treat all files as text and compare them line-by-line, even if they do not
4611 .It -b
4612 .It --ignore-space-change
4616 .It -B
4617 .It --ignore-blank-lines
4621 .It --binary
4625 .It -c
4629 .It -C Va lines
4630 .It --context[= Va lines]
4644 .Op - Va lines
4646 .Op -c
4648 .Op -p .
4649 POSIX 1003.1-2001 (see Section
4652 .Op -C Va lines
4655 .It --changed-group-format= Va format
4658 to output a line group containing differing lines from both files in if-then-else
4662 .It -d
4663 .It --minimal
4669 .It -D Va name
4670 .It --ifdef= Va name
4675 See Section.Dq If-then-else .
4677 .It -e
4678 .It --ed
4684 .It -E
4685 .It --ignore-tab-expansion
4689 .It -f
4690 .It --forward-ed
4693 script but has changes in the order they appear in the file.See Section
4696 .It -F Va regexp
4697 .It --show-function-line= Va regexp
4703 .It --from-file= Va file
4705 .Va file
4707 .Va file
4710 .It --help
4713 .It --horizon-lines= Va lines
4721 .It -i
4722 .It --ignore-case
4723 Ignore changes in case; consider upper- and lower-case letters equivalent.See Section
4726 .It -I Va regexp
4727 .It --ignore-matching-lines= Va regexp
4732 .It --ignore-file-name-case
4733 Ignore case when comparing file names during recursive comparison.See Section
4736 .It -l
4737 .It --paginate
4743 .It --label= Va label
4746 instead of the file name in the context format (see Section
4753 .It --left-column
4757 .It --line-format= Va format
4760 to output all input lines in if-then-else format.See Section
4763 .It -n
4764 .It --rcs
4765 Output RCS-format diffs; like
4766 .Op -f
4770 .It -N
4771 .It --new-file
4772 In directory comparison, if a file is found in only one directory, treat it
4776 .It --new-group-format= Va format
4779 to output a group of lines taken from just the second file in if-then-else
4783 .It --new-line-format= Va format
4786 to output a line taken from just the second file in if-then-else format.See Section
4789 .It --old-group-format= Va format
4792 to output a group of lines taken from just the first file in if-then-else
4796 .It --old-line-format= Va format
4799 to output a line taken from just the first file in if-then-else format.See Section
4802 .It -p
4803 .It --show-c-function
4807 .It -q
4808 .It --brief
4812 .It -r
4813 .It --recursive
4817 .It -s
4818 .It --report-identical-files
4822 .It -S Va file
4823 .It --starting-file= Va file
4824 When comparing directories, start with the file
4825 .Va file .
4829 .It --speed-large-files
4834 .It --strip-trailing-cr
4838 .It --suppress-common-lines
4842 .It -t
4843 .It --expand-tabs
4848 .It -T
4849 .It --initial-tab
4854 .It --tabsize= Va columns
4860 .It --to-file= Va file
4862 .Va file
4864 .Va file
4867 .It -u
4871 .It --unchanged-group-format= Va format
4874 to output a group of common lines taken from both files in if-then-else format.See Section
4877 .It --unchanged-line-format= Va format
4880 to output a line common to both files in if-then-else format.See Section
4883 .It --unidirectional-new-file
4884 When comparing directories, if a file appears only in the second directory
4888 .It -U Va lines
4889 .It --unified[= Va lines]
4903 .Op - Va lines
4905 .Op -u .
4906 POSIX 1003.1-2001 (see Section
4909 .Op -U Va lines
4912 .It -v
4913 .It --version
4916 .It -w
4917 .It --ignore-all-space
4921 .It -W Va columns
4922 .It --width= Va columns
4928 .It -x Va pattern
4929 .It --exclude= Va pattern
4935 .It -X Va file
4936 .It --exclude-from= Va file
4939 .Va file .
4942 .It -y
4943 .It --side-by-side
4954 .Bd -literal -offset indent
4963 At most one of these three file names may be
4964 .Pa - ,
4967 to read the standard input for that file.
4979 .Bl -tag -width Ds
4980 .It -a
4981 .It --text
4982 Treat all files as text and compare them line-by-line, even if they do not
4986 .It -A
4987 .It --show-all
4997 .It --diff-program= Va program
5003 .It -e
5004 .It --ed
5015 .It -E
5016 .It --show-overlap
5018 .Op -e ,
5022 .Op -E ,
5025 .Bd -literal -offset indent
5033 .It --help
5036 .It -i
5045 .Op -AeExX3
5047 .Op -m .
5048 See Section.Dq Saving the Changed File .
5050 .It --label= Va label
5054 .Op -A ,
5055 .Op -E
5057 .Op -X
5058 options. This option may be given up to three times, one for each input file.
5060 .Li diff3 --label X --label Y --label Z -m A B C
5062 .Li diff3 -m A B C ,
5075 .It -m
5076 .It --merge
5077 Apply the edit script to the first file and send the result to standard output.
5083 .Op -A
5087 .It --strip-trailing-cr
5091 .It -T
5092 .It --initial-tab
5097 .It -v
5098 .It --version
5101 .It -x
5102 .It --overlap-only
5104 .Op -e ,
5108 .It -X
5110 .Op -E ,
5112 .Op -x ,
5114 .Op -E .
5117 .It -3
5118 .It --easy-only
5120 .Op -e ,
5130 .Bd -literal -offset indent
5138 .Bd -literal -offset indent
5143 .Op -i Va patchfile
5145 .Op --input= Va patchfile
5151 .Pa - ,
5157 If you do not specify an input file on the command line,
5163 output) which file to edit.See Section
5168 replaces the original input file with the patched version, possibly after
5169 renaming the original file into a backup file (see Section
5174 .Op -o Va file
5176 .Op --output= Va file
5178 .Va file
5189 Multiple single-letter options that do not take an argument can be combined
5192 .Bl -tag -width Ds
5193 .It -b
5194 .It --backup
5195 Back up the original contents of each file, even if backups would normally
5199 .It -B Va prefix
5200 .It --prefix= Va prefix
5203 to backup file names.See Section
5206 .It --backup-if-mismatch
5207 Back up the original contents of each file if the patch does not exactly match
5208 the file. This is the default behavior when not conforming to POSIX.See Section
5211 .It --binary
5214 This option has no effect on POSIX-conforming systems like GNU/Linux. On systems
5216 .Li diff -a --binary .
5219 .It -c
5220 .It --context
5221 Interpret the patch file as a context diff.See Section
5224 .It -d Va directory
5225 .It --directory= Va directory
5228 the current directory for interpreting both file names in the patch file,
5229 and file names given as arguments to other options.See Section
5232 .It -D Va name
5233 .It --ifdef= Va name
5234 Make merged if-then-else output using
5236 See Section.Dq If-then-else .
5238 .It --dry-run
5242 .It -e
5243 .It --ed
5244 Interpret the patch file as an
5249 .It -E
5250 .It --remove-empty-files
5254 .It -f
5255 .It --force
5260 .It -F Va lines
5261 .It --fuzz= Va lines
5266 .It -g Va num
5267 .It --get= Va num
5275 .It --help
5278 .It -i Va patchfile
5279 .It --input= Va patchfile
5285 .It -l
5286 .It --ignore-white-space
5287 Let any sequence of blanks (spaces or tabs) in the patch file match any sequence
5288 of blanks in the input file.See Section
5291 .It -n
5292 .It --normal
5293 Interpret the patch file as a normal diff.See Section
5296 .It -N
5297 .It --forward
5301 .Op -R .
5304 .It --no-backup-if-mismatch
5309 .It -o Va file
5310 .It --output= Va file
5312 .Va file
5313 as the output file name.See Section
5316 .It -p Va number
5317 .It --strip= Va number
5318 Set the file name strip count to
5322 .It --posix
5328 .It --quoting-style= Va word
5337 .It -r Va reject-file
5338 .It --reject-file= Va reject-file
5340 .Va reject-file
5341 as the reject file name.See Section
5344 .It -R
5345 .It --reverse
5349 .It -s
5350 .It --quiet
5351 .It --silent
5355 .It -t
5356 .It --batch
5360 .It -T
5361 .It --set-time
5367 .It -u
5368 .It --unified
5369 Interpret the patch file as a unified diff.See Section
5372 .It -v
5373 .It --version
5376 .It -V Va backup-style
5377 .It --version=control= Va backup-style
5378 Select the naming convention for backup file names.See Section
5381 .It --verbose
5385 .It -x Va number
5386 .It --debug= Va number
5391 .It -Y Va prefix
5392 .It --basename-prefix= Va prefix
5398 .It -z Va suffix
5399 .It --suffix= Va suffix
5408 .It -Z
5409 .It --set-utc
5421 .Bd -literal -offset indent
5422 sdiff -o outfile options... from-file to-file
5426 .Va from-file
5428 .Va to-file ,
5432 .Va from-file
5434 .Va to-file
5437 compares the file in
5438 .Va from-file
5439 whose file name is that of
5440 .Va to-file ,
5442 .Va from-file
5444 .Va to-file
5449 .Li - ,
5451 .Va from-file
5453 .Va to-file
5455 .Li - .
5457 .Op --
5458 as an argument by itself treats the remaining arguments as file names even
5460 .Li - .
5462 .Pa -
5463 as an input file.
5467 .Op -o
5469 .Op --output )
5470 produces a side-by-side difference. This usage is obsolete; use the
5471 .Op -y
5473 .Op --side-by-side
5486 .Li - ,
5488 .Li -- .
5493 .Bl -tag -width Ds
5494 .It -a
5495 .It --text
5496 Treat all files as text and compare them line-by-line, even if they do not
5500 .It -b
5501 .It --ignore-space-change
5505 .It -B
5506 .It --ignore-blank-lines
5510 .It -d
5511 .It --minimal
5517 .It --diff-program= Va program
5523 .It -E
5524 .It --ignore-tab-expansion
5528 .It --help
5531 .It -i
5532 .It --ignore-case
5533 Ignore changes in case; consider upper- and lower-case to be the same.See Section
5536 .It -I Va regexp
5537 .It --ignore-matching-lines= Va regexp
5542 .It -l
5543 .It --left-column
5547 .It -o Va file
5548 .It --output= Va file
5550 .Va file .
5553 .It -s
5554 .It --suppress-common-lines
5558 .It --speed-large-files
5563 .It --strip-trailing-cr
5567 .It -t
5568 .It --expand-tabs
5573 .It --tabsize= Va columns
5579 .It -v
5580 .It --version
5583 .It -w Va columns
5584 .It --width= Va columns
5590 .Op -W
5593 .Op -w
5597 .It -W
5598 .It --ignore-all-space
5602 .Op -w
5605 .Op -W
5620 .Li diff lao tzu -C 2
5622 .Li diff -C 2 lao tzu ,
5625 is an option-argument of
5626 .Op -C .
5634 .Li diff -c -10
5636 .Li diff -C 10 ,
5637 but POSIX 1003.1-2001
5639 no longer allows digit-string options like
5640 .Op -10 .
5652 stands for POSIX 1003.2-1992, and
5654 stands for POSIX 1003.1-2001. For example, if you are running older software
5656 .Li diff -c -10 ,
5688 .Em Handling Multibyte and Varying-Width Characters
5702 incorrect in some locales, e.g., locales that use UTF-8 encoding. This causes
5704 .Op -y
5706 .Op --side-by-side
5714 .Lk http://oss.software.ibm.com/developer/opensource/linux/patches/i18n/diffutils-2.7.2-i18n-0.1.pa…
5727 with some subsidiary files, and another contains a file with the same name
5729 .Li diff -r
5732 to transform the directory subtree into the file.
5734 There should be a way to specify that a file has been removed without having
5735 to include its entire contents in the patch file. There should also be a way
5738 that a file was renamed, even if there is no way for
5742 that a file's time stamp has changed, even if its contents have not changed.
5755 treats symbolic links as if they were the pointed-to files, except that a
5766 cannot represent changes to such files. For example, if you change which file
5777 .Em File Names that Contain Unusual Characters
5779 When a file name contains an unusual character like a newline or white space,
5780 .Li diff -r
5787 because with odd enough file names one can cause
5792 output should be extended to handle all possible file names.
5798 to a multiple-file diff can result in files whose time stamps are out of order.
5812 .Va from-file
5814 .Va to-file ,
5821 in file 1 corresponds to
5823 in file 2, the lines are treated as identical.
5830 .Bd -literal -offset indent
5831 sed 's/foo/bar/g' file1 | diff - file2
5840 .Li cp -pR ) ,
5855 .Lk http://mail.gnu.org/mailman/listinfo/bug-gnu-utils
5856 .Mt bug-gnu-utils@gnu.org .
5860 .Mt bug-patch@gnu.org .
5863 .Op --version
5872 .Bd -filled -offset indent
5874 Suite 330, Boston, MA 02111-1307, USA
5877 document, but changing it is not allowed.
5880 .Bl -enum
5885 and useful document
5894 document must themselves be free in the same sense. It complements the GNU
5910 the terms of this License. Such a notice grants a world-wide, royalty-free
5917 A \(lqModified Version\(rq of the Document means any work containing the Document
5921 A \(lqSecondary Section\(rq is a named appendix or a front-matter section of the Document
5923 of the Document to the Document's overall subject (or to related matters)
5925 (Thus, if the Document is in part a textbook of mathematics, a Secondary Section
5931 as being those of Invariant Sections, in the notice that says that the Document
5933 of Secondary then it is not allowed to be designated as Invariant. The Document
5934 may contain zero Invariant Sections. If the Document does not identify any
5937 The \(lqCover Texts\(rq are certain short passages of text that are listed, as Front-Cover
5938 Texts or Back-Cover Texts, in the notice that says that the Document is released
5939 under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover
5942 A \(lqTransparent\(rq copy of the Document means a machine-readable copy, represented
5944 suitable for revising the document straightforwardly with generic text editors
5948 input to text formatters. A copy made in an otherwise Transparent file format
5956 available DTD, and standard-conforming simple HTML, PostScript or PDF designed
5960 and/or processing tools are not generally available, and the machine-generated
5971 A section \(lqEntitled XYZ\(rq means a named subunit of the Document whose title either
5975 \(lqPreserve the Title\(rq of such a section when you modify the Document means that
5978 The Document may include Warranty Disclaimers next to the notice which states
5979 that this License applies to the Document. These Warranty Disclaimers are
5987 You may copy and distribute the Document in any medium, either commercially
5989 the license notice saying this License applies to the Document are reproduced
6003 covers) of the Document, numbering more than 100, and the Document's license
6005 clearly and legibly, all these Cover Texts: Front-Cover Texts on the front
6006 cover, and Back-Cover Texts on the back cover. Both covers must also clearly
6011 the Document and satisfy these conditions, can be treated as verbatim copying
6018 If you publish or distribute Opaque copies of the Document numbering more
6019 than 100, you must either include a machine-readable Transparent copy along
6020 with each Opaque copy, or state in or with each Opaque copy a computer-network
6021 location from which the general network-using public has access to download
6022 using public-standard network protocols a complete Transparent copy of the
6023 Document, free of added material. If you use the latter option, you must take
6030 It is requested, but not required, that you contact the authors of the Document
6032 to provide you with an updated version of the Document.
6037 You may copy and distribute a Modified Version of the Document under the conditions
6040 the Document, thus licensing distribution and modification of the Modified
6044 .Bl -enum
6047 of the Document, and from those of previous versions (which should, if there
6048 were any, be listed in the History section of the Document). You may use the
6055 at least five of the principal authors of the Document (all of its principal
6063 Preserve all the copyright notices of the Document.
6076 Cover Texts given in the Document's license notice.
6085 in the Document, create one stating the title, year, authors, and publisher
6086 of the Document as given on its Title Page, then add an item describing the
6090 Preserve the network location, if any, given in the Document for public access
6091 to a Transparent copy of the Document, and likewise the network locations
6092 given in the Document for previous versions it was based on. These may be
6094 that was published at least four years before the Document itself, or if the
6103 Preserve all the Invariant Sections of the Document, unaltered in their text
6119 If the Modified Version includes new front-matter sections or appendices that
6120 qualify as Secondary Sections and contain no material copied from the Document,
6127 but endorsements of your Modified Version by various parties---for example,
6131 You may add a passage of up to five words as a Front-Cover Text, and a passage
6132 of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts
6133 in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover
6135 the Document already includes a cover text for the same cover, previously
6140 The author(s) and publisher(s) of the Document do not by this License give
6147 You may combine the Document with other documents released under this License,
6171 You may make a collection consisting of the Document and other documents released
6177 You may extract a single document from such a collection, and distribute it
6179 into the extracted document, and follow this License in all other respects
6180 regarding verbatim copying of that document.
6185 A compilation of the Document or its derivatives with other separate and independent
6189 the individual works permit. When the Document is included in an aggregate,
6191 not themselves derivative works of the Document.
6194 the Document, then if the Document is less than one half of the entire aggregate,
6195 the Document's Cover Texts may be placed on covers that bracket the Document
6196 within the aggregate, or the electronic equivalent of covers if the Document
6204 of the Document under the terms of section 4. Replacing Invariant Sections
6208 of this License, and all the license notices in the Document, and any Warranty
6214 If a section in the Document is Entitled \(lqAcknowledgements\(rq, \(lqDedications\(rq, or
6221 You may not copy, modify, sublicense, or distribute the Document except as
6223 sublicense or distribute the Document is void, and will automatically terminate
6238 Document specifies that a particular numbered version of this License \(lqor any
6241 been published (not as a draft) by the Free Software Foundation. If the Document
6248 To use this License in a document you have written, include a copy of the
6249 License in the document and put the following copyright and license notices
6252 .Bd -literal -offset indent
6255 Permission is granted to copy, distribute and/or modify this document
6258 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
6264 If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace
6267 .Bd -literal -offset indent
6270 the Front-Cover Texts being list, and with the Back-Cover Texts
6278 If your document contains nontrivial examples of program code, we recommend