Linux GUI diff utilities a visual tour
showing differences in files
If you edit a lot of configuration files, and are confronted a lot with the configuration files edited by others, you probably spend a lot of time looking at the changes made to the file since the last time it was edited or installed. The standard command line utility diff does a reasonable job when it comes to finding small differences. It shows that it wasn't developed to create the best possible human readable output when you try reading long listings.
diff output looks something like this:
2c2
<
---
> text in file 1
12,14d11
< text in file 2
< which is not
< in file 1
great for changing code with patch, a little less great for editing text by hand.
If you just need a quick and dirty side by side view of a small piece of text, sdiff is your tool.
Output of sdiff is like this:
test text, to show differences with sdifftest text, to show differences with sdiff
test <
text text
to | test
> toto
show differences sdiff shows show differences sdiff shows
Luckily there are a lot of possible choices for more advanced diff utilities:
vimdiff
If you need to stick with the command-line there's vimdiff, vimdiff is a startup option of vim. And if your used to the vi commands this is a great file comparison option. Vimdiff is started by entering
#vimdiff file1 file2
on the command line. You can open a number of files in a split view this way. It's also possible to start the diff mode when you're already in the editor. If you have a file opened in vim and you do give the command
:diffsplit {filename}
click on the screenshots for larger images:
![]()
unfolding in vimdiff is done by putting your cursor on the fold and pressing the keys z-o
fold it again with z-c
remember this by thinking of the z as a folded line and o is open / c is close.
vimdiff supports syntax coloring, code folding, multiple buffers, well all standard vim features. The only thing is that you have to know vi commands to work with it. While there's always a good reason to learn vi
(it boosts your productivity),you might be more interested in other tools if you are not used to the vi editing style yet.
gvimdiff
There's also gvim this is a gui version of vi which sports a file menu and other gui options. And so there's also gvimdiff, which is a gui version of vimdiff. Gvimdiff can be started from the command line just like vimdiff by entering
#gvimdiff file1 file2
gvim is a great tool in itself and if you need to learn vi it helps you a lot by giving lists of commands and other helpful info.
In gvim you can open multiple files in split screens, this is normal mode. You can also start a diff from the menu file--split diff with, this gives you a split screen with all settings like in vimdiff. Code is folded where it's not different, just unfold by clicking the + in the sideline.
Gvim is a vi bases editor and therefore it has a editing and command mode. To enter edit mode you enter one of the edit keys and to re-enter command mode you use esc. Working with vi based editors takes some getting used to, this is as well a weak point as a strong point of this program. If your used to vi or vim, your definitely going to like this one. In other cases it's something you need to learn and if you're in a hurry you'dd better try one of the other tools.
click on the screenshots for larger images:
![]()
Emacs
Emacs has similar features and a command line and GUI mode also.
When in emacs press Meta-x followed by ediff-files, and you'll be asked for the filenames which you want to compare.
emacs supports a lot of diff commands for a full list and the manual go here:
click on the screenshots for larger images:
![]()
If your used to emacs text editing the ediff function is probably your choice when comparing files, emacs has great support for comparing files. It compares to vi in productivity and speed if your used to it.
If you don't know it's command structure and don't have time to learn, you're probably better off with one of the GUI only text comparing tools.
The GUI file differencing tools can roughly be divided into the ones which let you edit in place and the ones that don't. I personally like to have the ability of editing the files I'm looking at, but for a quick compare of 2 files many of this tools come in hand. It's all a matter of personal preference.
Kompare
Kompare has a clear interface where you see differences between files and you have the ability to apply the differences to the target file. A lightweight application which doesn't allow for editing in the windows.
Kompare has several different options for ignoring whitespace (tabs, spaces, blank lines,tab expansion)
It has an ignore case option and options for regular expression match ignoring.
Excluding files is an option in directory comparison.
The external diff program can be set and there's color configuration available.
That's pretty much it. Kompare is a relatively simple tool, but if that's just what you need it serves it's purpose well.
click on the screenshots for larger images:
![]()
edit: there's a second page!
page2 --->
Popular content
Recent blog posts
- HP linux netbook
- Toshiba Android netbook
- android video terminal
- rugged android phone
- Linux PC Robot < 500$ DIY Linux robot
- Q7 Linux MID nice but missing most important feature
- BD remote for android available soon
- Intelligent Linux based scriptable network camera
- Edge the first foldable dual screen ebook reader/netbook
- iPed chinese for iPad
don't forget to vote if you find something useful!!
- Hm
42 weeks 4 days ago - What is it called?
43 weeks 1 day ago - i done everything . when i
46 weeks 12 hours ago - 11. Be logged in with more
48 weeks 4 days ago - Additions to computer user
48 weeks 4 days ago - Source code Philips tv
48 weeks 5 days ago - philps 5604 source code
48 weeks 5 days ago - Getting a error ___Main__.PY error any ideas?
1 year 2 days ago - Meh....
1 year 2 weeks ago - not the smallest
1 year 2 weeks ago
Navigation
Arduino starter kit
nederlandse arduino tutorials

Smallest Linux PC, smaller
than an apple

Linux home automation

Electrical superbike
powered by Linux

Coolest Linux robot ever
transforming,camera,
remote control

Samsung tv Linux hack

Linux multimedia
dream machine

More cool stuff
like this solid gold macbook
at criticalcold.com
Tags
Best karma users
- mr-Z
- Ian_js
- dave-d
- gamer2k2
- links9
Categories



diff ftw
Anonymous 2 years 33 weeks 5 days 17 hours ago
I was always a fan of just using plan old diff and outputting it to a patch file, either that or SVN! Let that sit for a while and think about it :)
Beyond Compare blows all these out of the water!
Anonymous 2 years 43 weeks 4 days 6 hours ago
I still can't believe that people don't know about Beyond Compare. It is "THE" compare program to use. It is by no means free, but it is professional grade, and nothing comes close to it. And NO i don't work for them, I have just been using it for 5+ years on the windows platform and I am very happy that they've finally got a port for Linux! Give it a try and you'll see for your self that this is the only way to compare files AND folders.
edit:link removed, it's on page 2
Sourcegear's Diffmerge
Anonymous 2 years 48 weeks 1 day 1 hour ago
http://www.sourcegear.com/diffmerge/ is available for Linux, Mac, and Windows. It's free-as-in-beer, but not open source.
I like xxdiff
Anonymous 2 years 48 weeks 3 days 4 hours ago
If you need to go GUI, use xxdiff!
http://furius.ca/xxdiff/
Other diff apps.
Anonymous 2 years 48 weeks 3 days 15 hours ago
I normally use kdiff3 which a few others have previously mentioned.
The other utility I sometimes use is tkdiff:
I recently needed to put a visual diff app on my eeePC 701. I wanted kdiff3 but gave up after repository difficulties. Thus I used tkdiff, a visual diff utility written in tcl/tk. This language allowed me to create a single-file executable (a starpack) and simply copy it to the eeePC - no dependency or other problems...
Diffuse is also extremely portable
Anonymous 2 years 48 weeks 2 days 5 hours ago
Diffuse is also very portable. It just needs Python and PyGTK which are present on practically every Linux distribution. All of the support files are completely optional. Just copy /usr/bin/diffuse to another machine and use it.
what about kdiff3 ?
Anonymous 2 years 48 weeks 5 days 10 hours ago
what about kdiff3 ?
Other possibilities...
Anonymous 2 years 48 weeks 5 days 10 hours ago
I would recommend checking out meld, http://meld.sourceforge.net/, and jedit's jdiff plugin.
for meld see the next comment
admin 2 years 48 weeks 5 days 9 hours ago
meld is on page 2, see the next comment.
I'll look into jdiff and add it as soon as I find the time.
Where's meld ? And kdiff3 ?
Anonymous 2 years 48 weeks 5 days 10 hours ago
Where's meld ? And kdiff3 ?
meld
admin 2 years 48 weeks 5 days 9 hours ago
for meld check out page 2!
there's a link at the bottom page2 --->
or direct:
http://www.handlewithlinux.com/Linux-GUI-diff-utilities-a-visual-tour-page2
I'll be adding kdiff3 as soon as I find the time
I've updated the text to make the link to the second page a "little" clearer :-)