|
Quick links About
sdiff Syntax Examples
Related commands Linux / Unix main page
About sdiff
Compares two files,
side-by-side.
Syntax
sdiff [ -l ] [ -s ] [ -o output ] [ -w n ]
filename1 filename2
| -l |
Print only the left side of any lines that are
identical to. |
| -s |
Just prints the lines that are different. |
| -o
output |
Use the argument output as the name of a third file that is created as a user-controlled merge of filename1 and filename2. Identical lines of filename1 and filename2 are copied to output. Sets of differences, as produced by diff , are printed; where a set of differences share a common gutter character. After printing each set of differences,
sdiff prompts the user with a % and waits for one of the following user-typed commands:
| l |
Append the left column to the output file. |
| r |
Append the right column to the output
file.
|
| s |
Turn on silent mode; do not print
identical lines. |
| v |
Turn off silent mode. |
| e l |
Call the editor with the left column. |
| e r |
Call the editor with the right column. |
| e b |
Call the editor with the concatenation of left and right. |
| e |
Call the editor with a zero length file. |
| q |
Exit from the program.
On exit from the editor, the resulting file is concatenated to the end of the output file. |
|
| -w n |
Use the argument n as the width of the
output line. The default line length is 130 characters. |
| filename1 |
The first name of the file that you want to compare. |
| filename2 |
The second name of the file that you want to compare. |
Examples
sdiff myfile.txt myfile2.txt - Would lists
results similar to the below. is this ln
| cat in the hat
Hello world
<
this is a test
<
of the ed editor <
Related commands
diff
ed
|
|
| Resolved | Were you able to locate the answer to your questions? |
|
|