I wanted to compare lines in 2 files and write things which
are common in a different file.
File1 (has line like below)
File2 (has line like below)
Which ever is common among file1 and file 2 should be written to file3
Grep does it :
grep -f file1 file2 > file3
file3 will have host2, host3 from above example shown under it.