Linux and Unix sdiff command
Quick links
About sdiff
Syntax
Examples
Related commands
Linux and Unix main page
Compares two files, side-by-side.
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:
|
||||||||||||||||||
| -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. |
sdiff myfile.txt myfile2.txt
Lists results similar to the below.
is this ln | cat in the hat
Hello world <
this is a test <
of the ed editor <
