Imagining that i have this text :
Quote:
ewrwrwerwetew
ttyt56hfghh
user
7547754
36346fgjfgj
|
I want to search for an exact string and get the line number in that text file from where it is .
Using grep for exact match i can use :
Code:
grep "\<user\>" <textfile
but how do i get the line number from where "user" word it is ?
in the text above , "user" is in line 3 , how can i get that value ?