To search within files we can use the command grep (man grep). Basic usage is as follows:

grep -Ril "mail" /var/www/

This will search our web root folder (/var/www/) for any text with the word ‘mail’ inside it.

  • R – Recursive
  • i – uppercase/lowercase
  • l –  Show file name instead of actual location
Categories: Linux


Leave a Reply

%d bloggers like this: