Sim, é possível com a opção -n de grep .
Em man grep :
-n, --line-number
Prefix each line of output with the 1-based line number within its input file.
Por exemplo, se você tiver um arquivo chamado file.txt tendo:
this is
foo test
and this is
bar test
Agora, a saída de grep -n "test" file.txt :
$ grep -n "test" file.txt
2:foo test
4:bar test
Aqui 2 e 4 indicam os números de linha onde o padrão é encontrado.