UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: sdbChapter 2
UNIX Commands
Next: Reference: sed
 

sdiff

sdiff [options] file1 file2

Produce a side-by-side comparison of file1 with file2. Output is:

text text

Identical lines.

text <

Line exists only in file1.

> text

Line exists only in file2.

text | text

Lines are different.

Options

-l

List only lines of file1 that are identical.

-o outfile

Send identical lines of file1 and file2 to outfile; print line differences and edit outfile by entering, when prompted, the following commands:

e

Edit an empty file.

e b

Edit both left and right columns.

e l

Edit left column.

e r

Edit right column.

l

Append left column to outfile.

q

Exit the editor.

r

Append right column to outfile.

s

Silent mode; do not print identical lines.

v

Turn off "silent mode."

-s

Do not print identical lines.

-wn

Set line length to n (default is usually 130).

Example

Show differences using 80 columns, and ignore identical lines:

sdiff -s -w80 list.1 list.2


Previous: Reference: sdbUNIX in a Nutshell: System V EditionNext: Reference: sed
Reference: sdbBook IndexReference: sed

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System