Search for a string in multiple files

grep is a common command used on unix for searching. This is a very useful tool and provides powerful options. One such option is to search for a string in multiple files in the current directory and sub directories. The command is :

grep -rl "search string" /usr

-r stands for search recursively in current directory and sub directory.
-l suppress the display of additional information and just outputs the file names.
/usr refers to root folder under which the search happens.

Comments

Popular posts from this blog

Delete multiple lines in Linux style Vi Editor

Mysql on XAMPP performance issues and tuning

Change Firefox Browser Default View Source Editor to your Favorite Text Editor