awk 'NR==FNR{a[$0]=$0;next}$0 in a{print}' file2 file1 [download]
In reply to Re: problem while reading multiple files by suhailck in thread problem while reading multiple files by rajyalakshmi