Linux shell diff utility with highlite

I want to be able the difference with two files and HIGHLIGHT the difference in each line, NOT just the full line

For example, if the diff output is

< This is 123 line
---
> This is xyz line

I want the 123 and xyz to be highlighted.
pmsguyAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
tmarques1000Connect With a Mentor Commented:
Try colordiff  http://colordiff.sourceforge.net/

diff -Nau orig new | colordiff
diff orig new | colordiff
colordiff -Nau orig new
colordiff orig new

Try hidiff too: http://www.perlmonks.org/?node_id=648150
(need curses for perl, on debian: libcurses-perl)

hidiff orig new
0
 
jghelfman40Connect With a Mentor Commented:
I don't believe that is possible, however if you used a gui tool like 'meld' that would be.

http://meld.sourceforge.net/

On it not being possible, after a quick google search I found this site that uses a hilight tool with diff:
http://www.debian-administration.org/articles/464
0
 
SuperdaveConnect With a Mentor Commented:
Vim will also do that for you (with -d option or invoked as vimdiff)
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
pmsguyAuthor Commented:
Thanks about the vimdiff, I knew that already.

I want to have the diff go to stdout so I can do easy automation via the command line.
0
 
jghelfman40Connect With a Mentor Commented:
To the author:


Did you look at the debian url I had posted? That is what it does.
0
 
pmsguyAuthor Commented:
The above solutions are good for editors.

However, I want the output to go to stdout and not an editor.

This way I can use a script to see process diffs and pipe to less.

Therefore, I am looking for a script to HIGHLIGHT the diff in the line, not the whole line.

vimdiff does this, but again, I want the output to go to stdout.
0
 
jghelfman40Connect With a Mentor Commented:
My first comment with the url does exactly that. Pipe through something to stdout.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.