01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DIFF ( 1) DIFF(l)<br />

NAME<br />

diff - differential file and directory comparator<br />

SYNOPSIS<br />

diff [ -1 ] [ -r ] [ -8 ] [ -cefh ] [ -b ] dirl dir2<br />

diff [ -cefh ) [ -b ] filel file2<br />

diff [ -Dstring ] [ -b ] filel file2<br />

DESCRIPTION<br />

If both arguments are directories, diff sorts the contents of the<br />

directories by name, and then runs the regular file diff algorithm<br />

(described below) on text files which are different. Binary files<br />

which differ, common subdirectories, and files which appear in<br />

only one directory are listed. Options when comparing directories<br />

are:<br />

-1 long output format; each text file diff is piped through<br />

pr(l) to paginate it, other differences are remembered and<br />

summarized after all text file differences are reported.<br />

-r causes application of diff recursively to common subdirectories<br />

encountered.<br />

-8 causes daff to report files which are the same, which are<br />

otherwise not mentioned.<br />

-Sname<br />

starts a directory daff in the middle beginning with file<br />

name.<br />

When run on regular files, and when comparing text files which<br />

differ during directory comparison, diff tells what lines must be<br />

changed in the files to bring them into agreement. Except in rare<br />

circumstances, diff finds a smallest sufficient set of file differences.<br />

If neither file1 nor file2 is a directory, then either may be given as<br />

'-', in which case the standard input is used. If file1 is a directory,<br />

then a file in that directory whose file-name is the same as<br />

the file-name of file2 is used (and vice versa).<br />

There are several options for output format; the default output<br />

format contains lines of these forms:<br />

n1 a n9, n4<br />

n1,n2 d n9<br />

n1, n2 c n9, n4<br />

These lines resemble ed commands to convert file1 into file2. The<br />

numbers after the letters pertain to file2. In fact, by exchanging<br />

'a' for 'd' and reading backward one may ascertain equally how to<br />

convert file2 into file1 . AE. in ed, identical pairs where n1 = n2 or<br />

n9 = n4 are abbreviated as a single number.<br />

Following each of these lines come all the lines that are affected in<br />

the first file flagged by '< ', then all the lines that are affected in<br />

the second file flagged by '>'.<br />

Except for -b, which may be given with any of the others, the<br />

following options are mutually exclusive:<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!