Visual Diff Tools in Linux

| |
[不指定 2008/09/07 21:05 | by ipaddr ]
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 - this is a read-only output. No editing or merging is possible. But its a great tool for a quick visual inspection.

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.

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:

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.

Guiffy:

Multi-platform visual diff and merge tool. Has a three-pane view for comparing two-files and the third pane to view the merged output file. Works in Window, Linux and Mac OS X. Folder comparison is possible.

I am sure there are more tools out there (such as xxdiff) but I don't feel like reviewing them (too ugly). :)

kdiff3:

An excellent tool from the kde bunch. I loved it. Has the option to compare 2 or 3 files. Has an extra window pane to look at the out of the merged file. Directory differences and merging are possible.
OS | 评论(0) | 引用(0) | 阅读(6631)