print the line on which text occurs using grep bash
I would like to grep a file for certain text, and output ONLY the line number on which it occurs. Example:

File.text:

firstsentance
secondsentance
thirdsentance


if I grep for secondsentance I should receive an output of 2.  

 
print the line on which text occurs using grep bash
===

I would like to grep a file for certain text, and output ONLY the line number on which it occurs. Example:

File.text:

firstsentance
secondsentance
thirdsentance


if I grep for secondsentance I should receive an output of 2.  

 