bash
$ cat input.txtkorn is excellent
c is superb
bash is best
bash is handy
all are best
$ grep -n "bash" input.txt | sed '1!d'
3:bash is best
$ grep -n "bash" input.txt | sed '1!d' | awk -F : '{print $1}'
3
$ awk -F : '/bash/ {print NR}' input.txt
3
4
$ awk -F : '/bash/ {print NR}' input.txt | sed '1!d'
3