views:

1628

answers:

2

I'm sure I once found a unix command which could print the common lines from two or more files, does anyone know its name? It was much simpler than diff.

+8  A: 

The command you are seeking is comm.

Jonathan Leffler
+8  A: 

Maybe you mean comm ?

Compare sorted files FILE1 and FILE2 line by line.

With no options, produce three-column output. Column one contains lines unique to FILE1, column two contains lines unique to FILE2, and column three contains lines common to both files.

The secret in finding these information are the info pages. For GNU programs, they are much more detailed than their man-pages. Try info coreutils and it will list you all the small useful utils.

Johannes Schaub - litb