I have 2 files I need to compare the contents of and create a third file that contains only what is common to both files. Below is an example, the actual files contain thousands of entries.
file 1
G00127
G00653
G00737
G00744
File 2
G00127
G00252
G01328
File 3 (desired output)
G00127
file 1
G00127
G00653
G00737
G00744
File 2
G00127
G00252
G01328
File 3 (desired output)
G00127