Saturday, October 6, 2012

Install Tkdiff on Linux

If you want a visual comparison between two files on Linux, then vimdiff is available for you, but the visual presentation is very ugly.  Vimdiff comes with vim.   Fortunately Tkdiff is available for Linux and it is easy to install if you know how.

Here are directions for installing Tkdiff on Linux.  My primary machine is a Windows box, so I download using my Windows box and then move files over to my Linux box. If you download from the internet using your Linux box, the directions might be very similar, but a little different.

Use this link to download Tkdiff for Linux:
http://sourceforge.net/projects/tkdiff/files/tkdiff/4.2/tkdiff-4.2.tar.gz/download

Use WinZip extract once to get from tkdiff-4.2.tar.gz to tkdiff-4.2.tar
Use WinZip extract again to get from tkdiff-4.2.tar to folder called tkdiff-unix which has these files:
CHANGELOG.txt
LICENSE.txt
README.txt
tkdiff

Move the entire folder to your linux box, although you really only need the tkdiff file.  When you place licensed software on your linux box, I think it is appropriate to have the license on the machine.

Change tkdiff to Unix format, and put it in the bin directory.  Here are the commands to do this.  Of course, when you execute su to become root, you must know the root password.

dos2unix tkdiff
su
cp  tkdiff  /usr/local/bin/


Now you can go to some directory and execute
tkdiff  file another_file
and see the difference.

You will be please to see the visual improvement over vimdiff.  If you downloaded directly onto the Linux box, the tkdiff file might not be in DOS format.  The program dos2unix fixes the carriage return differences between Unix and Windows.

I will also mention that there is a Windows version available here.
http://sourceforge.net/projects/tkdiff/
The Windows version has an installer called TkDiff-4.2-Setup.exe
I prefer Kdiff3 for comparing files on Windows.  I installed Tkdiff instead of Kdiff3 on Linux because Tkdiff is generally much easier to install on Linux.

Robert

May 2017: Tkdiff is nice because you can put it on media and install it on a computer that does not have a decent visual tool for diff'ing files.  However, if you are on a Linux computer, look and see if the kompare (on KDE systems) or meld  (on Gnome systems) tools are available.  Then you won't need Tkdiff.

No comments:

Post a Comment

Comments require my approval before they appear. Be patient. It will take a day or two for your comment to appear.