I'm using grep to match string in a file, here is example file :
example one,
example two null,
example three,
example four null,
grep -i null myfile.txt returns
example two null,
example four null,
How can I return matched line + line number like this :
example two null, - Line number : 2
example four null, - Line number : 4
Total null count : 2
I know -c returns total matched lines but I don't how to format it properly to add total null count in front and I don't know how to add line number. Any help would be great