I'm a big fan of meld - a visual diff and merge tool for Gnome. It shows two files (or directories) side by side with their differences highlighted and I can easily select which parts I want to move from one file to the other.

I'm looking for a similar tool but it should work on the (linux) console, eg. do not require any X server. Maybe using a ncurses interface.

Is there such tool?


Ah just found out about vimdiff. It pretty much does what I was looking for. here's a quick guide

| improve this answer | |
  • 1
    @How to merge/copy changes from on file to another using vimdiff or vim -d – goldenmean Nov 16 '10 at 15:12

You can use vim -d file1 file2 for that.

| improve this answer | |

sdiff, a classic command line tool which shows text file differences side by side, also has an interactive merge mode. Use it by running

$ sdiff -o output.txt input1.txt input2.txt

It is the default interactive command line merge tool used by Gentoo Linux' etc-update utility.

Advantages over vimdiff are ubiquitous availability and much simpler handling.

| improve this answer | |
  • Easy to use, just press 1 or 2 to choose the wanted version. However, columns are truncated to only show 60 charcartes, and changes must be saved to a third file. – simlev Jan 7 '19 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.