I have two files that look this:
file1:
apples
pears
grapes
oranges
melon
file2:
gene1 apples
gene2 television
gene3 pears
gene4 homeless
desired output:
gene1 apples
gene3 pears
I want to use awk to compare column1 of file1 with column2 of file2 and print out the whole line of file2? How can I do this?