Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Node:Side by Side, Next:, Previous:Context, Up:Output Formats

Showing Differences Side by Side

diff can produce a side by side difference listing of two files. The files are listed in two columns with a gutter between them. The gutter contains one of the following markers:

white space
The corresponding lines are in common. That is, either the lines are identical, or the difference is ignored because of one of the --ignore options (see White Space).
|
The corresponding lines differ, and they are either both complete or both incomplete.
<
The files differ and only the first file contains the line.
>
The files differ and only the second file contains the line.
(
Only the first file contains the line, but the difference is ignored.
)
Only the second file contains the line, but the difference is ignored.
\
The corresponding lines differ, and only the first line is incomplete.
/
The corresponding lines differ, and only the second line is incomplete.

Normally, an output line is incomplete if and only if the lines that it contains are incomplete; See Incomplete Lines. However, when an output line represents two differing lines, one might be incomplete while the other is not. In this case, the output line is complete, but its the gutter is marked \ if the first line is incomplete, / if the second line is.

Side by side format is sometimes easiest to read, but it has limitations. It generates much wider output than usual, and truncates lines that are too long to fit. Also, it relies on lining up output more heavily than usual, so its output looks particularly bad if you use varying width fonts, nonstandard tab stops, or nonprinting characters.

You can use the sdiff command to interactively merge side by side differences. See Interactive Merging, for more information on merging files.


 
 
  Published under the terms of the GNU General Public License Design by Interspire