<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Tech-Recipes - Latest Comments in Kill the undesired UNIX processes in one go | UNIX | Tech-Recipes</title><link>http://tech-recipes.disqus.com/</link><description>Cookbook of Tech Tutorials</description><language>en</language><lastBuildDate>Wed, 18 Apr 2007 03:21:56 -0000</lastBuildDate><item><title>Re: Kill the undesired UNIX processes in one go | UNIX | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/742/kill-the-undesired-unix-processes-in-one-go/#comment-2768780</link><description>&lt;code&gt;&lt;br&gt;egrep -v &amp;quot;ps|sh|PID&amp;quot; file | awk '&amp;#123;print $1&amp;#125;' | xargs kill&lt;br&gt;&lt;/code&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Wed, 18 Apr 2007 03:21:56 -0000</pubDate></item><item><title>Re: Kill the undesired UNIX processes in one go | UNIX | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/742/kill-the-undesired-unix-processes-in-one-go/#comment-2768779</link><description>Hi,&lt;br&gt;&lt;strong&gt;PID  TTY            COMMAND&lt;br&gt;  2345 ?         0:00 msgcntl //&lt;br&gt;  4977 pts/tc    0:00 ps&lt;br&gt;  3807 ?         0:00 spectrum&lt;br&gt;  3813 ?         0:00 msgcntl //&lt;br&gt;  3802 ?         0:00 printmgr&lt;br&gt;  3814 ?         0:00 ssmcntl//&lt;br&gt;  3810 ?         0:00 ptrcntl//&lt;br&gt;  3815 ?         0:00 ssmcntl//&lt;br&gt;  3811 ?         0:00 termcntl//&lt;br&gt;  3817 ?         0:00 ssmcntl//&lt;br&gt;  3816 ?         0:00 pccntl//&lt;br&gt;  3798 ?         0:00 rsetcntl//&lt;br&gt;  2215 pts/tc    0:00 sh&lt;/strong&gt;&lt;br&gt;&amp;lt;font color="blue"&amp;gt;&lt;strong&gt;In the above scenario, I have to kill all the process except ps and sh . How to do that ?&lt;/strong&gt;&amp;lt;/font&amp;gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Sun, 15 Apr 2007 20:02:05 -0000</pubDate></item><item><title>Re: Kill the undesired UNIX processes in one go | UNIX | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/742/kill-the-undesired-unix-processes-in-one-go/#comment-2768778</link><description>&amp;lt;ul id="quote"&amp;gt;&amp;lt;h6&amp;gt;jproctor wrote:&amp;lt;/h6&amp;gt;Sorry to appear thick, but could you give an example of processname-patern&lt;br&gt;thanks for posting this great help jproctor&amp;lt;/ul&amp;gt;&lt;br&gt;&lt;br&gt;you can use pgrep and pkill</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Fri, 02 Mar 2007 00:08:00 -0000</pubDate></item><item><title>Re: Kill the undesired UNIX processes in one go | UNIX | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/742/kill-the-undesired-unix-processes-in-one-go/#comment-2768777</link><description>You can use the following command :&lt;br&gt;&lt;br&gt;kill -9 `ps -ef | grep &amp;lt;process-name&amp;gt; | grep -v grep | awk '{print $2}'`&lt;br&gt;&lt;br&gt;Just make sure that you keyin the correct process name in the above command.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Thu, 01 Mar 2007 16:53:06 -0000</pubDate></item><item><title>Re: Kill the undesired UNIX processes in one go | UNIX | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/742/kill-the-undesired-unix-processes-in-one-go/#comment-2768776</link><description>a kill -9 doesnt give the process the possibility to clean up; to exit "voluntarily". can screw up its data.&lt;br&gt;&lt;br&gt;always try a kill (without -9) first</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Holger</dc:creator><pubDate>Wed, 27 Apr 2005 11:15:52 -0000</pubDate></item><item><title>Re: Kill the undesired UNIX processes in one go | UNIX | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/742/kill-the-undesired-unix-processes-in-one-go/#comment-2768775</link><description>i think you might want to look into the killall command</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">casper</dc:creator><pubDate>Tue, 08 Mar 2005 01:58:56 -0000</pubDate></item><item><title>Re: Kill the undesired UNIX processes in one go | UNIX | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/742/kill-the-undesired-unix-processes-in-one-go/#comment-2768774</link><description>That's a good question.  Using grep has a brief but steep learning curve.  Most UNIX commands do.  Once you get the basics, you can put grep to powerful use.&lt;br&gt;&lt;br&gt;In the most basic usage, grep will search through text looking for the search string.  If you want to look for commands containing the string 'http' you would simply use:&lt;br&gt;&lt;br&gt;&lt;code&gt;   ..... | grep http | .... &lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Grep stands for global regular expression parser and is a magnificently powerful tool.  The important thing to take out of that mouthful is 'regular expression' which is a formal language for representing elaborate wildcards for searching.  For example, a period matches any single character, so &lt;strong&gt;.at&lt;/strong&gt; would match bat, cat, rat, and so on.  Used in a grep statement, it would match that regular expression anywhere in the line, so it would also match brat and bats.  Regular expressions would be a great idea for a series of rec.pes.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">qmchenry</dc:creator><pubDate>Sun, 19 Dec 2004 14:11:10 -0000</pubDate></item><item><title>Re: Kill the undesired UNIX processes in one go | UNIX | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/742/kill-the-undesired-unix-processes-in-one-go/#comment-2768773</link><description>Sorry to appear thick, but could you give an example of processname-patern&lt;br&gt;thanks for posting this great help jproctor</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Wed, 15 Dec 2004 22:43:14 -0000</pubDate></item></channel></rss>