On Sat, Jan 10, 2004 at 04:47:18AM +1100, Michael Kraus wrote: > G'day... > > > I am using now quite often the -v option to grep since I learnt of that > > one. It removes a pattern from the imput to grep. Quite useful. > > Especially when checking for the existence of a process running... > > For example: > > # ps -xwa | grep process-name | grep -v grep
I like this bit of cleverness: # ps -xwa | grep [p]rocess-name This pattern will match what you're after but won't match itself. So, no need to grep -v grep! BTW, linux has the pgrep command now. Much nicer to use that grep'ing ps output. -- Matt -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html