Daily Crumbs

July 2nd, 2007

Killing all processes with a particular grep string

Posted by Administrator in Observations | Edit

So if you want to see which processes are running with a particular string:
ps -ef | grep [string]
If you do:
ps -ef | grep "httpd"
You will get all processes with httpd in it/such as /usr/local/bin/httpd start

Now if you got a whole bunch of responses back you can to terminate those processes:
ps -ef | grep httpd |xargs kill

RIGHTSIDE