I\'m using grep to match string in a file. Here is an example file:
example one, example two null, example three, example four null,
grep
Use -n or --line-number.
-n
--line-number
Check out man grep for lots more options.
man grep