[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

regular expressions and grep



Hi,

I just can't seem to get the hang of regular expressions.  I am trying to use
grep to look at relevant lines in my system log, for example I can do this:

>grep -v named /var/adm/daemon.log

This shows all but the lines containing the word "named" (because my named
daemon shows a lot of garbage on boot up).  But there are several lines I 
would like to leave out, like those containing the word "smtpd".  I have not 
been able to figure out how to combine the two strings so that grep -v  ignores
both of them, I've had to resort to

>grep -v named /var/adm/daemon.log | grep -v smtpd

It seems silly to have to run grep a separate time for each string I wish 
to exclude, can someone tell me how to combine the strings in the manner that
I desire?

Thank you kindly,
Steve



Reply to: