Search text inside a file recursively

By | August 15, 2009

When you need to search recursively inside a structure of directories you need to run the following command from the console:

find /srv -type f -follow -exec grep –with-filename –line-number “apache2ctl” {} ;

This will search in every file from every folder from /srv and will show in which file and at each line it finds the right information.

Cheers,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.