!diff — Finding lines that are the same between 2 files
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




An ex collegue came up with the following, which also works quite nice (and is a lot easier)
$ comm -1 -2 FILE1 FILE2
comm is part of gnu coreutils
Maniac
20 Apr 09 at 21:31