Re: desired diff feature: show common lines

[email protected] (Bob Proulx)
Newsgroups gmane.comp.gnu.utils
Message-ID <[email protected]>
Chris Konig Beatty wrote:
> I would sometimes like see the common lines of two files only. I haven't 
> been able to make diff show me that, might not be its purpose.

As far as I know 'diff' doesn't support that functionality.  You
should look at the 'sdiff' program.  It will show differences side by
side and effectively shows the lines that are the same.

> Would it be easily (enough) to add that functionality to diff?

It really isn't the job of diff to do this.

> I might miss the existence of some other tools. Obviously, there might 
> not be enough demand for that feature anyway.

If the files are sorted the 'comm' program is designed to do this.

There are a number of tools that will show the differences between two
files side by side.  Here are a few.

  emacs-emerge
  meld
  mgdiff
  sdiff
  tkdiff
  xxdiff

Bob
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.