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
.
The command you are seeking is comm
. eg:-
comm -12 1.sorted.txt 2.sorted.txt
Here:
-1 : suppress column 1 (lines unique to 1.sorted.txt)
-2 : suppress column 2 (lines unique to 2.sorted.txt)