sdiff
text processingLinux/Unix
The sdiff command is one of the most frequently used commands in Linux/Unix-like operating systems. sdiff Side-by-side merge of file differences
Quick Reference
Command Name:
sdiff
Category:
text processing
Platform:
Linux/Unix
Basic Usage:
sdiff [options] [arguments]
Common Use Cases
Syntax
sdiff [options] file1 file2
Options
Option | Description |
---|---|
-a, --text |
Treat all files as text |
-b, --ignore-space-change |
Ignore changes in the amount of white space |
-B, --ignore-blank-lines |
Ignore changes where lines are all blank |
-d, --minimal |
Try hard to find a smaller set of changes |
-E, --ignore-tab-expansion |
Ignore changes due to tab expansion |
-i, --ignore-case |
Ignore case differences in file contents |
-I RE, --ignore-matching-lines=RE |
Ignore changes whose lines all match regular expression RE |
-l, --left-column |
Output only the left column of common lines |
-o FILE, --output=FILE |
Operate interactively, sending output to FILE |
-s, --suppress-common-lines |
Do not output common lines |
-t, --expand-tabs |
Expand tabs to spaces in output |
-v, --version |
Output version information and exit |
-w NUM, --width=NUM |
Output at most NUM (default 130) print columns |
-W, --ignore-all-space |
Ignore all white space |
-Z, --ignore-trailing-space |
Ignore white space at line end |
--help |
Display this help and exit |
Examples
How to Use These Examples
The examples below show common ways to use the sdiff
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
sdiff file1.txt file2.txt