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...
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...
tail -f access.log | grep -v 'MSIE' |grep -v Mozilla
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks :-) I was trying to avoid doing two | greps's
:-)
:-)