Winmerge is the best program for comparing files and directories in Windows. What is the equivalent in Linux? How do you compare your disk to a backup to find differences? How do you compare multiple disks to merge files without duplication?
Updated for Beyond Compare on Linux.
Files or directories
Winmerge does more than one job, Winmerge compares directories and files. Winmerge works fast with both large files and large directories.
Winmerge compares directories and highlight all the differences, both files that are missing from one directory, and files that are different.
Winmerge can can display the files side by side with differences highlighted and both sides editable. You can copy changes from one file to another to merge the differences without accidentally writing over something you want t keep.
Gnome or KDE?
Linux has two main user interfaces, Gnome and KDE. Gnome is the default and the most popular. KDE has fewer users and, in some areas, fewer programs that work with KDE. Many KDE programs work in Gnome but drag along a massive KDE overhead.
I use Gnome and Gnome derivatives including Cinnamon. I can perform extensive testing on Gnome programs. I occasionally test KDE programs under Gnome, if they have that options, and under KDE. My infrequent experience of KDE is of a series of broken releases where the KDE fans say I should update to the new release which is not quite ready. For KDE programs under Gnome, the result is usually the installation of a massive KDE overhead then the program breaks.
I will stick to native Gnome applications under Gnome.
I also tested some compare programs under OSX and they turned out to be just source code compares, not alternatives to Winmerge.
This page started a long time ago. I update the page every year or two as the compare programs change.
Worth a look
The following program is worth looking at. Installation and removal on Ubuntu Linux is so easy that you can install, test, and clean up in 10 minutes.
I originally did not find anything for Linux that does what Winmerge does. Meld is now close enough to be worth a look if the only thing you do in life is edit source code. Meld used to fail on medium size directories and now works but is often slow and difficult.
There are several programs that do only one part of what Winmerge does. If you search for the answer to
What is the equivalent to Winmerge in Linux?, you get 118000 pages recommending the same programs for comparing two or three text files and some of them are as good as Winmerge for text file compares but not for anything else.
Some of the recommended programs can compare directories of source code but not anything else. Almost every project on a computer uses some files that are not text files. You need a program to compare directories containing any type of files. There is nothing recommended for Linux that works.
There are some other nice features of Winmerge. When you switch from Winmerge to the primitive user interface of some Linux programs, it is enough to send you back to Windows. I currently keep several projects on big external disks formatted to NTFS so I can access the disks from Windows and use Winmerge on Windows.
Other comparison programs
Many Linux applications are just pretty front ends for utilities. A serious problem with the utility approach is the lack of communication between the utility and the front end. Progress information is misleading. Error messages can be useless. If the utility can only compare text files, directory compares are useless for anything outside of a simple program source code comparison.
The following programs all look like they were designed purely to compare directories of source code. You cannot compare directories of photographs or project directories containing files in a format that is not text. The following programs cannot compete with Winmerge because they cannot compare files.
If you make money from work utilising file or directory comparisons, you might want to look at investing in a commercial comparison tool. I do not normally recommend commercial tools because of the license problems but Beyond Compare is starting to look useful on Linux at a time when Meld still has problems.
Beyond Compare has an image comparison you can use to find mystery changes in projects. Think of the occasions when you compare a test Web site to the production Web site and find images slightly different in size. They look the same when you display them site by side. Beyond Compare can highlight pixel changes.
Beyond Compare has two versions, the standard version at US$30 and the Pro version at US$50. The Pro version includes SFTP, the only option for accessing public servers. Buy the Pro version or nothing.
There is a full function downloadable demo I might test one day. There is a new version 4 in beta release and I would go straight for that, perhaps holding off purchase until it leaves beta.
$50 is a lot of money for the small extra features of Beyond Compare, compared to Winmerge on Windows. I would pay that if I had to compare many images.
Beyond Compare now has versions for Linux and OSX. $50 easily covers the time I waste on Meld when a project grows a little bit bigger than what Meld can handle. Each version of Meld works with larger directories but still does not work with my largest projects. Meld does not have image comparison. The Linux version of Beyond Compare would have saved me $500 on one project last year if it had been available then.
Thank you to Straughan for pointing out the Linux version of Beyond Compare.
KDiff3 is a monster download because KDiff3 uses KDE and has to install KDE under Gnome. In effect KDiff3 duplicates the Gnome user interface with KDE then runs in the duplicate. Use the smaller KDiff3-qt because Qt works under Gnome.
KDiff3 is listed in the Ubuntu Software Centre and can be downloaded from http://kdiff3.sourceforge.net/. The download is 63.2 MegaBytes and the program uses a massive 228 MB on disk because of all the KDE junk.
A KDiff3 side by side comparison of two text files looks like the Winmerge side by side comparison. KDiff3 lets you compare three files at the same time and this is the one real advantage of KDiff3/Meld, a small number of Linux source code compare programs.
KDiff3 is a monster download because KDiff3 has to also install KDE. KDiff3-qt is KDiff3 with the KDE overhead removed. KDiff3-qt is dependent only on Qt. The one big disadvantage of KDiff3-qt is the need to start KDiff3-qt using the 1950s terminal emulation program, the awful DOS/Linux/Command line interface.
KDiff3-qt is listed in the Ubuntu Software Centre and can be downloaded from http://kdiff3.sourceforge.net/. The download is 7.9 MegaBytes and the program uses 27.8 MB on disk.
A KDiff3-qt compare is the same as the standard KDiff3.
Eclipse is a monster program written in Java and has lots of add on programs including comparison and diff programs. You install the Java monster first then the Eclipse monster then all the add-ons you want. Eclipse is not worth the effort unless you use many of the Eclipse features.
Kompare looks like Meld and a bunch of other graphical front ends for text file comparisons. You can can compare directories but not directories containing anything other than text, making Kompare useless for most comparisons.
Kompare is in the Ubuntu Software Centre and can be downloaded at http://www.caffeinated.me.uk/kompare/.
Meld performs two and three way text file comparisons using an external utility. Meld originally compared directories then failed on binary files, making Meld useless for comparing disks or backups or projects or just about everything. Meld now works with directories containing pictures and some other binary files.
Meld is in the Ubuntu Software Centre and can be downloaded at http://meld.sourceforge.net/. The download is only 3532 KiloBytes and it uses only 2.2 MB on disk.
On July 2012, I tested the latest Meld and was nice. Not quite Winmerge nice yet. There were some silly little things in the user interface. I thought I could live with the differences and switched most of my compares to Meld. Given the current rate of improvement for Meld, I expected all the user interface weirdness to disappear in the next release. Read more in Meld.
In October 2013, I upgraded to Meld 1.8.2 but the result is not nice. The start up screen is a disaster for directory compares.
Xxdiff is a graphical user interface and uses an external utility, GNU diff, SGI diff, or ClearCase cleardiff, to perform file comparisons. Because xxdiff cannot perform a native file comparison, an xxdiff directory comparison is almost always useless for everything I do. The best xxdiff can do is compare two directories of source code.
To make matters worse, you have to start xxdiff through a 1950s DOS/Linux/Unix command line. Instead of browsing for your files or directories, you have to use something else to find the files then write down the file names then type the file names in as part of the xxdiff command. Primitive. Useless.
Xxdiff is listed in the Ubuntu Software Centre. The download is 3.8 MegaBytes and the program uses 11 MB on disk.
Xxdiff is written in C++ and could be compiled on any operating system. Xxdiff uses Qt for the user interface graphics and Qt runs on most operating systems including mobile phone operating systems. Xxdiff works on Linux, Unix, the Unix named OSX, and Windows but the Windows version is out of date.
An xxdiff side by side comparison of two text files looks like the Winmerge side by side comparison, except for the formatting. Xxdiff starts with black text on an an ugly grey background that makes the text hard to read. One of the first changes to xxdiff should be to switch off that background colour.
I deleted xxdiff after a few frustrating attempts to use it.