Search for specific string in files/directories with line number in linux

Problem

You want to search in a directory or some files for a specific string and you also want to know the number in the file that the text is found.

Solution

Use grep with the -n for the line number and the -r for directory search as in the following: