Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need a GUI program for Linux (Ubuntu Karmic) like tkdiff, which can display 2 files side-by-side, and highlight the differing lines, and it accepts multiple file pairs on the command line, but displays only one file pair at a time, and lets me jump to the next or previous file pair by pressing a key. Which is the best program for this?

I've tried tkdiff and meld, but it seems to be impossible to specify more than 2 files for these on the command-line.

share|improve this question
I believe older versions of tkdiff (3.x) had this feature, and newer ones (4.x) do not. – user138820 Jun 8 '12 at 0:34

Try arranging for the files to compare to have the same name in different directories, i.e., comparing foo/file1 with bar/file1, foo/file2 with bar/file2, etc. You can use symbolic links. Then use a diff tool that understands comparing directories. Emacs is one such tool (menu “Tools / Compare / Two directories” or M-x ediff-directories).

share|improve this answer
Thanks for suggesting this workaround. However, I'm still looking for a more straightforward solution, which avoids creating temporary files (or symlinks) and directories, just to do a multifile comparison. – pts Aug 28 '10 at 11:07

I've been fighting with TkDiff multi-pair diffs also. So far I've only managed to get the very unhelpful:

Error: you specified 6 file(s) and 0 revision(s)

...but I'll add my experience and some notes here.

Perforce here at work is already does the right thing for me.

Here's what ps says for a nice working Perforce multi-pair diff (I've moved every separate argv item onto it's own line):


From this I'm guessing that part of what's missing in Leon's answer above is the '--' and ':' before the first file pair. BUT this is not enough.

Our perforce version of TkDiff is ancient (3.0x) so I'm trying to use my locally installed 4.1.x version. But no luck so far...

Manually running this works:

wish /tools/eng/perforce/tkdiff.tcl -- : "/tmp/g4-60077/cache/depot/path/to/file1#740" /home/douglasdd/work/src1/path/to/file1 : "/tmp/g4-60077/cache/depot/path/to/file2#15" /home/douglasdd/work/src1/path/to/file2

But manually running this fails:

wish /usr/local/bin/tkdiff -- : "/tmp/g4-60077/cache/depot/path/to/file1#740" /home/douglasdd/work/src1/path/to/file1 : "/tmp/g4-60077/cache/depot/path/to/file2#15" /home/douglasdd/work/src1/path/to/file2

...with the dreaded:

Error: you specified 6 file(s) and 0 revision(s)

From which I'm force to wonder if perhaps Perforce has their own custom-hacked version of TkDiff??

Sorry this doesn't really help.

share|improve this answer

I like kdiff3 it can do 2 or 3 files - and can compare directories.

share|improve this answer
This doesn't answer my question. Many diff tools can compare 2 or 3 files. I'm interested in a diff tool which can compare more than 1 file pair, which I can specify on the command line. – pts Aug 28 '10 at 11:05
sorry I don't know of any tool that does this - it would be simple to write a small script that calls kdiff or similar for each pair of files passed to it – Adam Butler Aug 28 '10 at 18:39
Thanks for coming up with a 2nd suggestion (a shell script which calls kdiff multiple times), but it still doesn't answer my question. In my question I explicitly specify the requirement that the program ``lets me jump to the next or previous file pair by pressing a key''. – pts Aug 28 '10 at 23:37
up vote 0 down vote accepted

Since nobody could suggest a tool which matches my requirements, most probably there is none.

share|improve this answer

tkdiff is really poorly documented, but it seems that if you separate file pairs by a colon, it'll do the diff you want. E.g.

tkdiff a.1 a.2 : b.1 b.2 : c.1 c.2
share|improve this answer
This doesn't work with tkdiff 4.1.4, I get `You specified 5 file(s) and 0 revision(s) – pts Sep 19 '10 at 13:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .