Fooblog

Foobar's blog and linkdump

Archive for the ‘diff’ tag

!diff — Finding lines that are the same between 2 files

with one comment

Someone asked if there was a way for diff to only show lines that are the same between 2 files. A little digging in the manpage for gnu diff got me this nice result:

diff --unchanged-line-format=%L --old-line-format= --new-line-format= FILE1 FILE2

This seems to work… but i’m open to other suggestions

Written by foobar

April 16th, 2009 at 2:08 pm

Posted in hacking,Just Blogging Stuff,tech

Tagged with , ,