You can search for text within a directory with the below command. Please note that . refers to the current directory

grep -r “search text” .

To search a file

find -name filename /var/www/

To search 2 different words

egrep -w ‘firstword|secondword’ /var/www

By admin

Leave a Reply

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