Recursive search for a word in directory contents with grep and rgrep

   An easy way to search for a word within directory contents is the ‘rgrep’ command:

   

       rgrep “word /some/directory

   If you don’t have the rgrep command installed on your distribution, you can use grep with the following flags:

   

       grep -rnw “word/some/directory

    

   Example:

   

       grep -rnw “Failed password” /var/log/auth.log

   will list you all unsuccessful login attempts on your machine.