Wednesday, October 6, 2010

Line number that a specific string value occurs

If you want to find the line number of where specific string values occur within a given file in Linux you can use the grep command with the switch -n.

Example:

grep -n "string" filename