Name
sdiff
Synopsis
sdiff [options
]file1 file2
Produce a side-by-side comparison of file1 with file2. Output is:
-
text text
Identical lines.
-
text
<
Line that exists only in file1.
-
>
text
Line that exists only in file2.
text
|text
Lines that are different.
GNU/Linux and Mac OS X both use the GNU version of sdiff.
Common Options
-l
,--left-column
List only lines of file1 that are identical.
-o
outfile
,--output=
outfile
Send identical lines of file1 and file2 to outfile; print line differences and edit outfile by entering, when prompted, the following commands:
|
Edit an empty file. |
|
Edit both left and right columns. |
|
Edit left column. |
|
Edit right column. |
|
Append left column to outfile. |
|
Exit the editor. |
|
Append right column to outfile. |
|
Silent mode; do not print identical lines. |
|
Turn off “silent mode.” |
-s
,--suppress-common-lines
Do not print identical lines.
-w
cols
,--width=
cols
Set line length to cols (default is 130).
GNU sdiff Options
-a
,--text
Treat all files as text and compare line-by-line.
-b
,--ignore-space-change
Ignore differences in whitespace.
-B
,--ignore-blank-lines
Ignore added or missing blank lines.
-d
,--minimal
Use a different algorithm to find fewer changes. This option causes sdiff to run more slowly.
-
--diff-program=
program
Use program in place of the standard version of diff.
-E
,--ignore-tab-expansion
Ignore changes occurring because of tab expansion.
-H
,--speed-large-files
Heuristically speed comparison of large files with many small ...
Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.