Any visual diff in the Linux console?

Many years ago, I used d32 , which was available for DOS and Linux.

Is a non-GUI visual diff available for Linux like this?

Any other than Vim and Emacs (Vim and Emacs are too powerful :-))

+58
diff
Jan 02 '09 at 10:53 on
source share
11 answers

I am using vimdiff . Or there is also sdiff .

+49
Jan 02 '09 at 10:57
source share

If you're comfortable with git , you can also use git diff to create a path for you. This usually gives you beautiful colors, the less page, and displays the default unified diff format. It will work regardless of whether the files are part of the git repository.

 git diff -- file.a file.b 

If file.a and file.b are in the git repository and are not tracked, you need to provide --no-index :

 git diff --no-index -- file.a file.b 

since git will be different from index by default.

+18
Feb 27 '13 at 11:01
source share

You can try ColorDiff .

+17
Jan 02 '09 at
source share

None of the existing answers here are suitable for my use case, but I found cdiff , which is a great little software that does exactly what I need:

A term-based tool for viewing color, incremental scatter in the Git / Mercurial / Svn workspace or from stdin, side by side and with automatic pager support.

Side-by-side mode looks like this:

side by side diff output

+15
Sep 25 '14 at 21:04
source share

Vim comes with vimdiff , which works very well ...

+8
Jan 02 '09 at
source share

Personally, I like to use vimdiff. But if you do not know vim, which will not be useful to you.

+3
Jan 02 '09 at 10:57
source share

Your heading mentions the "Linux console", but your question mentions meld , which is a graphical application. This can help defendants if you can make this clear.

In GUI applications, meld is still pretty much the standard. It works well, it is quite beautiful and intuitive.

If you are really limited to using the console (i.e. just for text), then besides the diff utilities built into editors like vim and emacs , you can also try the diff command-line utility. It’s very useful for me to use the -y option to display files side by side, and there are other options that I used to display β€œunified” differences and to accurately determine the amount of context in the mapped differences. If you pass the diff output to less , you can view it conveniently.

+3
Jan 02 '09 at 11:03
source share

vimdiff will do what you want. Vim is installed by default for most Linux distributions, so you probably don't even need to install anything.

+2
Jan 02 '09 at
source share

Emacs has a built-in visual demarcation tool: Mx ediff .

+2
Jan 02 '09 at
source share

I started rebuilding xxdiff in the console (since I completely switched to developing the tmux console) into a new Python-based single-file tool, which I call "termdiff". I ran into compatibility problems with curses, so now I put it on ice, I just need some time to fix the minor problems with filling the empty space, but it is currently popping up an output that looks just like xxdiff, and you can pass it on to less.

http://furius.ca/xxdiff/bin/termdiff

Try termdiff --cat or termdiff --less, it works.

In the meantime, I am using custom configuration and ediff for Emacs, but to begin with, I'm a bit sluggish, I still need a special diff-startup program on the console.

+1
Jan 07 '15 at 20:30
source share

Midnight Commander (mc) has a built-in diff and much more useful features. Try:

sudo apt install mc

+1
Nov 10 '17 at 13:41
source share



All Articles