Saturday, October 2, 2010

Howto: Tkdiff - a great comperation tool

Tkdiff is very useful small tool that's based on the original Unix "diff" command but much more "eye friendly".
Imagine a situation where you have to compare 2 huge files/XML templates/ router configurations etc... well you got the point, the process can be much more smoother using this great tool, let's see how to install it and some basic usage:

In my case I used CentOS 5.4 virtual machine, but any Unix/Linux flavor will do.
Tkdiff has a dependency of "tk" package which is an addon for TCL scripting language which allows to create GUI apps.

So first we shall install tk package:

#yum install tk

Download the "tkdiff" RPM package from any repository you chose, like this one:


And install it:
#rpm -ivh tkdiff-6.3-1.noarch.rpm

If you want to compare 2 files named file1 file2, the usage is as follows:

#tkdiff file1 file2

Here we can see that "123" is same on both files, while the difference is at line contains string "456" ,which  exists only in file2.

A sure great tool for any admin, engineer, developer.

Have fun.

No comments: