Link to home
Start Free TrialLog in
Avatar of wildzero
wildzero

asked on

Grep with OR and -v

Hi there,

I am trying to grep my access log to remove all MSIE and Mozilla lines..

If I do
bash$ tail -f access.log | grep -v 'MSIE'
then I exclude all MSIE no problem.
but if I change it so
'MSIE|Mozilla'
or
"MSIE|Mozilla"
or
even try both with "(MSIE|Mozilla)"
then it will just show all as usual...
how can I use grep to exclude MSIE and Mozilla
thinking about it now... the | = or so that with -v might be my downfall...
Avatar of ozo
ozo
Flag of United States of America image

tail -f access.log | grep -v 'MSIE' |grep -v Mozilla
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wildzero
wildzero

ASKER

Thanks :-) I was trying to avoid doing two | greps's
:-)