grep -xFf file1 file2
The meaning of the flags:
-x -- match complete lines-F -- treat the patterns as fixed strings instead of regular expressions-f FILE -- take patterns from FILEAll of these flags are critical to perform the intended task accurately.