BMX Bicycle freestyle
BMX Bicycle freestyle

Friday, October 15, 2010

Grep OR - How to Grep for Two Terms in Linux?

How to grep for two terms at the same time?

Code:
ps ax | egrep 'firstTerm|secondTerm'

Example:
ps ax | egrep 'anacron|xscreensaver'
Output:
 3857 ?        S      0:00 xscreensaver -no-splash
 7209 ?        Ss     0:00 anacron -s
10947 pts/0    S+     0:00 egrep anacron|xscreensaver

0 comments:

Post a Comment