Visual Diff Tools in Linux

Running the regular diff between two text files to see the differences is not so elegant for the human eye to decode. Luckily there are plenty of tools out there to make this easy.

Command Line:

sdiff file-1 file-2

This is a much more elegant tool compared to diff, if you are looking for a quick command-line utility that shows the difference between two text files. While using it on big files, its better to pipe the output to less command.

sdiff file1 file2 | less

Disadvantage with this is read only output no editing or merging is possible. Update: Use sdiff -o out_file file1 file2 to interactively merge file1 and file2 and write the output into out_file. (Thanks to anonymous commenter)

Vimdiff:

vimdiff file-1 file-2

This can open "n" number of files in a vertically split vim environment. This has color highlighting to specify the areas that differ in the file. Editing is possible. This is a complete vim-environment, so all the vim keys are usable. Here is a quick and dirty tutorial on how to use vimdiff.

Emacs:

M-x ediff-buffers
This is an emacs equivalent of vimdiff with copy to left, copy to right, merge changes and much more. This is a special ediff mode which has its own key bindings. Hit ? to get help on the keyboard shortcuts.

Colored highlighting for distinguishing differences. Easy navigation to diff regions.

A maximum of 3 files can be compared and merged. Both comand-line and gui mode are available.

Visual Tools:

Meld:
Image borrowed from Meld website

Can compare two or three files and allows editing. The differences are dynamically updated. This can work with version control systems like CVS, SVN etc. Folder comparison is possible.

kdiff3:

Taken from the kdiff3’s website.

Directory differences and merging are possible.

Visual Diff Tools in Linux

స్పందించండి

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / మార్చు )

Twitter picture

You are commenting using your Twitter account. Log Out / మార్చు )

Facebook photo

You are commenting using your Facebook account. Log Out / మార్చు )

Google+ photo

You are commenting using your Google+ account. Log Out / మార్చు )

Connecting to %s