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.
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
Post a Comment