Find files containing a text string in subfolders using ‘grep’ in Ubuntu 12.04

 Posted February 27, 2016

Go to the folder you want to search in using cd:

For a simple list of files containing the example string “tags”:

Output:

 

To see each line containing the example string “tags”:

Output:

 

As above, but with line numbers after the filenames:

Output:

 

To search whole computer/server using sudo, using the above options:

 

Speak Your Mind

*