Open In App

sdiff command in Linux with Examples

sdiff command in linux is used to compare two files and then writes the results to standard output in a side-by-side format. It displays each line of the two files with a series of spaces between them if the lines are identical. It displays greater than sign if the line only exists in the file specified by the File2 parameter, and a | (vertical bar) for lines that are different.

Syntax:



sdiff [  -l | -s ] [  -o OutFile ] [  -w Number ] File1 File2

Example:
Text File 1:

Geeks
For 
Geeks

A 
Computer
Science
Portal
For
Geeks

Text File 2:



Geeks
For 
Geeks

Technical
Scripter
2018

Options of sdiff command:

Reference: https://www.tecmint.com/linux-sdiff-command-examples/

Article Tags :