![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| grep for pattern | aemunathan | Shell Programming and Scripting | 12 | 05-08-2008 11:58 PM |
| How to grep this pattern?? | askumarece | Shell Programming and Scripting | 13 | 02-20-2008 04:03 AM |
| help with grep the pattern | bluemoon1 | Shell Programming and Scripting | 2 | 09-20-2007 08:27 AM |
| unable to grep the following pattern | suri | Shell Programming and Scripting | 2 | 03-07-2007 12:03 AM |
| search pattern by grep | vijaysabari | Shell Programming and Scripting | 3 | 06-23-2004 12:03 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
look at -e option with grep
|
|
#3
|
|||
|
|||
|
I did - but have not been able to figure out how to use it - can you help?
Give an example etc? |
|
#4
|
|||
|
|||
|
grep -ce "root" -e "nobody" /etc/passwd
bakunin |
|
#5
|
|||
|
|||
|
Excellent - thank you very much!
|
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|