Comments on How to Compare and Merge Text Files on Linux

Comparing text files requires time, effort, a large monitor and a good amount of patience, or simply just the right tools to do it without any of the aforementioned. If you are an editor that has to deal with multiple versions of a text file, or a developer that wants to check the various code revisions of a file, then the following tutorial is for you.

10 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Drag

Meld is also a good tool to compare files :)

By: renfri

My favourite tool is kompare -> http://www.caffeinated.me.uk/kompare/

By: IVS

kdiff3, xxdiff, and vimdiff are probably more popular than the above. I'd usually opt for the kdiff3. As the previous poster mentioned meld is also an option, but like diffuse, it depends on python. kdiff3/xxdiff depend on Qt, and are written in C++. For real development, I found merging in meld to be less reliable than kdiff3 and xxdiff, although meld is nicer looking, and has syntax highlighting. In kdiff3, they deliberately choose not to implement syntax highlighting, apparently due to a belief that it isn't a good thing in a merge tool for clarity. I'd personally disagree, but otherwise it would be my favourite of these options.

By: Don Morse

I use Meld.  simple click and you can sync the files.

By: ElectricPrism

Or you could use Meld, haven't used Diffuse - but maybe I will.

By: Erik

Libreoffice? Come on… It's nice to know, but this is for an entirely different task.

This "article" sorely misses the best tools for the job: vim, emacs, kdiff3, xxdiff, meld.

I usually use vimdiff, or vim with the DirDiff plug-in, or kdiff3. I found meld less capable than others, but the UI is well designed. xxdiff would be good, but its UI is terrible.

By: Ademeion

I'm also a Meld user. It's easy to use and has all the features I have ever needed.

By: Doug

Or even Beyond Compare. 

By: Dave

Can't believe nobody has mentioned grep/diff. Sad but true, sometimes these gui apps just don't have the power for the heavy lifters, hopefully oneday!

By: PJ

Here is a handy incantation for comparing file differences between two nearly-identical directories, image1 and image2:"For scrutiny, the command:

  vimdiff <(cd image1; find . | sort) <(cd image2; find . | sort)

run from /cm/images/ shows the changed files for image directories image1 and image2, with uninteresting parts folded away."    (Bright Cluster Manager Administrator Manual)

Plain old diff and grep just isn't the right tool for this sort of result.