Seu file2 inclui uma substring que grep está correspondendo a uma das linhas de file1 .
Exemplo

Vocêpodevernacapturadetelaacima,otextoédestacadoemvermelhoporgrep.Aliás,vocêpodequererusarorecursodedestaquedecorestambém:
$grep--color=auto-ffile1file2
Maseuquerocombinarapenaspalavrasinteiras??
Sevocêquiserquegrepretornecorrespondênciasquesejam"palavras inteiras", inclua a opção -w . Isso só retornará correspondências são correspondências de palavras inteiras usando as "palavras" de file1 .
Aqui eu criei outro arquivo ( file1a ) que inclui o gene UNC79 .
$ grep C7 file1 file1a
file1:C7
file1a:C7
file1a:UNC79
Aqui, quando executo o comando grep -wf ... com os dois arquivos de índice ( file1 e file1a ), você pode ver que não recebemos correspondência para file1 e uma correspondência com file1a .
trecho da página man grep
-w, --word-regexp
Select only those lines containing matches that form whole words.
The test is that the matching substring must either be at the
beginning of the line, or preceded by a non-word constituent
character. Similarly, it must be either at the end of the line or
followed by a non-word constituent character. Word-constituent
characters are letters, digits, and the underscore.
Esse truque funciona na situação do @Ron porque seus nomes de genes são limitados por caracteres não-palavra ( = ) e são terminados com ( ; ). Caso contrário, esse truque provavelmente não funcionaria.