Ever need to find what you changed between two files or directories? The universal way to find these differences is to use the ‘diff’ command. The diff command is used by most open source projects, and people use it to communicate their changes / bug fixes etc.

Console using diff
Sometimes I find the diff command to be boring. Much like my terminal prompt, I like consoles to have color. The color helps me figure out what is going on a bit quicker. Do get diffs in color, you can ‘sudo apt-get install colordiff’. The resulting output will look like this instead:

Console with color diff
But there are some people out there who just don’t like consoles / terminals for one reason or another. There is also a GUI based diff tool called meld. You can install meld by running ‘sudo apt-get install meld’. Your diff will now look like this:

Screenshot of meld
That is a brief overview of the tools I have found useful, using screenshots.
Related posts:
#1 by Jonas on February 20, 2009 - 12:07 pm
Quote
I’ve never been much of a meld fan…works to be sure, but I’ve always found Kompare (YMMV) gives a better overview.
#2 by Deskin on February 20, 2009 - 12:30 pm
Quote
# apt-get install git-core
$ git diff –color file1 file2
OT: Your captcha system is broken, I wrote ‘twelve’ when it asked me to please add 6 and 6, but that wasn’t good enough
#3 by Lee Braiden on February 20, 2009 - 12:34 pm
Quote
Yep, colordiff, and especially meld, are great. Meld also supports version control systems, so you can do something like “meld .” in your bzr branch, and see browse the changes easily.
#4 by Dirk Deimeke on February 20, 2009 - 12:36 pm
Quote
Try vimdiff or gvimdiff for files and directories …
#5 by Igor on February 20, 2009 - 12:48 pm
Quote
Great article! I’m impressed that some developers don’t really know how to use the basic UNIX diff tools.
Its worth to say that most SCM tools out there include a diff tool already, some use the UNIX diff some doesn’t, but almost always you can diff your changes with the committed version doing a:
“scm tool” diff
for example:
git diff
svn diff
#6 by steve on February 20, 2009 - 3:15 pm
Quote
I have kdiff installed on nearly every box at work, great program.
#7 by Gregor on February 20, 2009 - 3:30 pm
Quote
I use meld regularly and love it – especially the directory comparison view, from which you can quickly “inspect” versions of files that are marked as being different!
#8 by jldugger on February 20, 2009 - 4:56 pm
Quote
Did you have to do anything to configure your shell to use colordiff instead of regular diff?
#9 by Steven Harms on February 20, 2009 - 5:22 pm
Quote
@jldugger
In that screenshot I believe I ran the same diff command then piped it to colordiff, but adding an alias to .bash_profile would do the trick also.