There is a very useful command in Linux, called grep. It is a utility for searching plain text files using regular expressions. You can either search files and folders as a parameter, or pipe command outputs to it, such as grep’ing a tail.

For looking for a file:

grep -r "string to find" /folder/to/look/in/

Thats the simple answer.

If you want to pipe the grep to monitor say a tail

tail -f /var/log/maillog | grep "chris@tatedavies.com"

 

By admin

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.