How can I "diff" two files with Nautilus?
There is a useful python extension that incorporates Meld into Nautilus
how to install
Obtain the source or the deb package from the authors website.
wget http://www.giuspen.com/software/nautilus-pyextensions_3.4.1-1_all.deb
sudo apt-get install python-nautilus
sudo dpkg -i nautilus-pyextensions_3.4.1-1_all.deb
Search for pyextension in Dash and run Nautilus PyExtension.
Activate the meld extension (install it if asked) and click the restart Nautilus toolbar option.
GConf error
In case you find an GConf related error when trying to open Nautilus PyExtension, install "gobject-introspection" and "gir1.2-gconf-2.0":
sudo apt-get install gobject-introspection
sudo apt-get install gir1.2-gconf-2.0
You can also install the nautilus-compare package, available (starting with Ubuntu 12.04) from the standard Ubuntu package repositories -- run the following from a terminal:
sudo apt-get install nautilus-compare
This provides nautilus menu options for 2-way and 3-way comparisons. Meld is used by default, but any user-defined diff application can be used.
A significant advantage of this solution is that one can compare files or folders located in different directories (e.g. /home/user/a/b/c/file.txt
and /home/user/d/e/f/otherfile.txt
can be opened in different Nautilus windows, and compared against each other).
Nautilus script
An easier and more efficient alternative to installing a dedicated extension would be using a Nautilus script like the following one:
#!/bin/bash
meld "$@"
Installation instructions: How can I install a Nautilus script?