40

Could somebody give me some recommendations on diff tools on Ubuntu? Actually what I need is not just file comparison, but also directory comparison.

I think diff tools under Windows is really most convenient, especially WinMerge.

But under Ubuntu, what I can get with high efficiency is only TkDiff, but it only support file comparison?

Hope to get some help from here.

BuZZ-dEE
  • 6,075
  • 12
  • 66
  • 96
BO KANG
  • 534
  • 1
  • 4
  • 7

6 Answers6

71

Meld is an actively-developed, open-source GUI-based diff utility targeted at developers.

  • It is free
  • It runs on Linux
  • GNU License
  • 40+ posts tagged as meld on Stack Overflow.
  • Actively developed through February 2013 (the time of this posting)
  • Allows two and three way comparison between files and folders
  • Supports Subversion, Git, and Mercurial
Community
  • 1
  • 1
Brian Webster
  • 30,033
  • 48
  • 152
  • 225
10

I usually use kdiff3 and happy with it. It can handle directories too.

Ilia K.
  • 4,822
  • 2
  • 22
  • 19
  • 2
    `meld` has one advantage over `kdiff3` which I learned just today. `meld` is capable of operating with process substitution-style input: `meld <(ls this) <(ls that)`, while `kdiff3` not so much. – Wojciech Migda Nov 23 '15 at 10:41
  • 1
    Wojciech your answer would actually be a right answer. Process substitution is invaluable for comparisons between ssh files and other less obvious diffs. – Paulo Neves Dec 08 '16 at 09:46
  • 2
    `kdiff3` resolves most conflicts automatically, `meld` can't do that. – Suor Aug 21 '17 at 05:02
5

It's not free software, but Beyond Compare is now available for Linux. I haven't used the Linux version but found BC2 invaluable for merging and comparing files and directories on Windows.

Gareth Davidson
  • 4,857
  • 2
  • 26
  • 45
1

I'm using the Krusader::Synchronize Directories (Ctrl+Y) tool for this task.

It compares directories and selects a newer files to rewrite the older ones automatically, then you can check the list of the differences and compare the files content (kdiff, kompare or xxdiff) while necessary. Finally you can start the synchronize action (copying files) itself.

It is crucial for this tool to have a file timestamps (modification time) set correctly.

petrnik
  • 11
  • 1
1

Although not opensource, p4merge is free and available on Linux, Windows and Mac. If you are used to Perforce, it will also feel familiar.

My personal taste is kdiff3 but p4merge worth to be mentioned.

JrBenito
  • 973
  • 8
  • 30
0

While I find kdiff3 utmostly confusing every time, for simple tasks I like the dirdiff utility (see its manpage). It is a graphical tool, and while not strong in features for merging, it lets you get a quick overview of relevant differences (hide non-relevant by doing "File -> Hide selection").

tanius
  • 14,003
  • 3
  • 51
  • 63