Comparing files in Nautilus with diff-ext

I spend a lot of time at the command line so my fingers can run diff commands faster than reaching for the mouse, but I was interested to see Ben Martin’s article on linux.com on doing a diff without touching the command line. Since Ubuntu Intrepid already has a package, enabling this is as simple as:

sudo apt-get install diff-ext

killall -15 nautilus

diff-ext-setup

(or you can install diff-ext using Synaptic, and log out and in again, and click on Applications > Programming > Diff-ext to configure it.)

The third step is to select a diff program to be launched by Nautilus – I use meld which supports 3-way diffs.

The article describes its usage:

Now you should be able to select two files in a directory in Nautilus, right-click to bring up the context menu, and notice a Compare entry toward the bottom of the menu. Selecting Compare will run your preferred diff utility on these files as shown in the adjacent screenshot.

If you have only a single file highlighted and bring up the context menu you will see “Compare later” in the context menu. Selecting that option places the path of the selected file onto a stack. The next time you select a single file you will see both “Compare later” and “Compare to ‘/…/first-file'” in the context menu.

f you select two files, you will be able to compare those two like before, but also have the option to run a three-way comparison with a file from the “Compare later” stack. Although I mention a compare stack, currently gdiff-ext only lets you compare with the very last thing you added to the “Compare later” stack.

If you select two directories and choose Compare, then both directories are passed to your nominated diff tool.

About these ads

5 Responses to “Comparing files in Nautilus with diff-ext”


  1. 1 Fer June 26, 2009 at 10:34 pm

    Thanks, looking for this long time.

  2. 2 Greg Noe March 11, 2010 at 4:18 am

    Thanks, this tool works great!

  3. 3 Roland B. December 4, 2010 at 12:07 pm

    Thanks! Works, and very useful for a developer like me! :) Linux power!!!

  4. 4 mosi July 2, 2011 at 5:14 pm

    Yes, thank you, very helpful. I am not such a great programmer, but what should one do in order to have similar feature as in Total Commander -> e.g. pressing Shift+F2 = compare all files in current directories???

    Do you have any tricks with diff command at the command line for this?

  5. 5 IFrei October 26, 2011 at 12:50 pm

    This does not work under Nautilus 3 on Ubuntu Oneiric. I found this one that seems to do the same thing: https://launchpad.net/nautilus-compare


Comments are currently closed.




Follow

Get every new post delivered to your Inbox.

%d bloggers like this: