How to get line number from grep?

no need for -r & -e !

get line number of a pattern!

grep -n "pattern" file.txt

if you want to get only the line number as output add another grep command to it !

grep -n "pattern" file.txt | grep -Eo '^[^:]+'

You should put -e at the end of the options list: grep -rne coll *