grep for more than one pattern

I want to grep for more than one pattern in a file...

ie.. grep for root and nobody in /etc/passwd file and then count the occurances..

Ideally I would want to do this but I know it doesnt work
grep -c root nobody /etc/passwd

Any ideas?

look at -e option with grep

I did - but have not been able to figure out how to use it - can you help?
Give an example etc?

grep -ce "root" -e "nobody" /etc/passwd

bakunin

Excellent - thank you very much! :slight_smile: