compare

comparing files line by line

Here's a way to compare two files that have common lines in both files:

sort file1.txt > file1_sorted.txt
sort file2.txt > file2_sorted.txt
comm -12 file1_sorted.txt file2_sorted.txt

Note: files need to be sorted first prior to comparing.

Comment