<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 4 Ways to Kill a Process &#8211; kill, killall, pkill, xkill</title>
	<atom:link href="http://www.thegeekstuff.com/2009/12/4-ways-to-kill-a-process-kill-killall-pkill-xkill/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thegeekstuff.com/2009/12/4-ways-to-kill-a-process-kill-killall-pkill-xkill/</link>
	<description>Guides, HowTos and Tips for Technology Geeks</description>
	<lastBuildDate>Thu, 09 Feb 2012 11:52:28 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Omari</title>
		<link>http://www.thegeekstuff.com/2009/12/4-ways-to-kill-a-process-kill-killall-pkill-xkill/comment-page-1/#comment-136735</link>
		<dc:creator>Omari</dc:creator>
		<pubDate>Thu, 03 Nov 2011 18:40:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=2547#comment-136735</guid>
		<description>When there are multiple processes using the same process name, you may want to kill one of the processes but not all.  Doing a &quot;pkill processname&quot; will kill all processes with that name (no matter how many processes there are).

Here&#039;s a bash script that I wrote that allows you specify which process of the processname&#039;s you want to kill.

you run it like so: &quot;script.sh processname filtername&quot;

This would kill all processname&#039;s that match filtername.

Here is script.sh:

#!/bin/bash
lookup=$1
finelookup=$2

PIDs=&quot;$(pgrep -l $lookup &#124; tr &#039; &#039; &#039;=&#039; &#124; awk -F= &#039;{print $1}&#039;)&quot;

for i in ${PIDs} ; do
        toKill=&quot;$(ps -ef &#124; grep $i &#124; grep $finelookup)&quot;
        if [ &quot;$toKill&quot; != &quot;&quot; ]; then
                kill -9 $i
        fi
done</description>
		<content:encoded><![CDATA[<p>When there are multiple processes using the same process name, you may want to kill one of the processes but not all.  Doing a &#8220;pkill processname&#8221; will kill all processes with that name (no matter how many processes there are).</p>
<p>Here&#8217;s a bash script that I wrote that allows you specify which process of the processname&#8217;s you want to kill.</p>
<p>you run it like so: &#8220;script.sh processname filtername&#8221;</p>
<p>This would kill all processname&#8217;s that match filtername.</p>
<p>Here is script.sh:</p>
<p>#!/bin/bash<br />
lookup=$1<br />
finelookup=$2</p>
<p>PIDs=&#8221;$(pgrep -l $lookup | tr &#8216; &#8216; &#8216;=&#8217; | awk -F= &#8216;{print $1}&#8217;)&#8221;</p>
<p>for i in ${PIDs} ; do<br />
        toKill=&#8221;$(ps -ef | grep $i | grep $finelookup)&#8221;<br />
        if [ "$toKill" != "" ]; then<br />
                kill -9 $i<br />
        fi<br />
done</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to Rotate Apache Log Files in Linux</title>
		<link>http://www.thegeekstuff.com/2009/12/4-ways-to-kill-a-process-kill-killall-pkill-xkill/comment-page-1/#comment-118774</link>
		<dc:creator>How to Rotate Apache Log Files in Linux</dc:creator>
		<pubDate>Fri, 22 Jul 2011 06:56:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=2547#comment-118774</guid>
		<description>[...] Important: Once you rotate the log files, you want apache to write the new log messages to the newly created access_log and error_log. So, you need to send the HUP signal to the apache as shown here. Make sure to do /usr/bin/killall -HUP httpd, which will restart the apache after rotating the log files (Read more about kill). [...]</description>
		<content:encoded><![CDATA[<p>[...] Important: Once you rotate the log files, you want apache to write the new log messages to the newly created access_log and error_log. So, you need to send the HUP signal to the apache as shown here. Make sure to do /usr/bin/killall -HUP httpd, which will restart the apache after rotating the log files (Read more about kill). [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: UNIX / Linux: 7 Practical PS Command Examples for Process Monitoring</title>
		<link>http://www.thegeekstuff.com/2009/12/4-ways-to-kill-a-process-kill-killall-pkill-xkill/comment-page-1/#comment-97629</link>
		<dc:creator>UNIX / Linux: 7 Practical PS Command Examples for Process Monitoring</dc:creator>
		<pubDate>Tue, 12 Apr 2011 06:03:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=2547#comment-97629</guid>
		<description>[...] and its options.  To monitor and control the processes, Linux provides lot of commands such as ps, kill, killall, nice, renice and top [...]</description>
		<content:encoded><![CDATA[<p>[...] and its options.  To monitor and control the processes, Linux provides lot of commands such as ps, kill, killall, nice, renice and top [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: UNIX / Linux: 3 Ways to Send Signal to Processes</title>
		<link>http://www.thegeekstuff.com/2009/12/4-ways-to-kill-a-process-kill-killall-pkill-xkill/comment-page-1/#comment-84757</link>
		<dc:creator>UNIX / Linux: 3 Ways to Send Signal to Processes</dc:creator>
		<pubDate>Tue, 08 Feb 2011 06:03:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=2547#comment-84757</guid>
		<description>[...] Note: Refer to 4 Ways to Kill a Process – kill, killall, pkill, xkill. [...]</description>
		<content:encoded><![CDATA[<p>[...] Note: Refer to 4 Ways to Kill a Process – kill, killall, pkill, xkill. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: goutam</title>
		<link>http://www.thegeekstuff.com/2009/12/4-ways-to-kill-a-process-kill-killall-pkill-xkill/comment-page-1/#comment-77958</link>
		<dc:creator>goutam</dc:creator>
		<pubDate>Sat, 08 Jan 2011 05:07:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=2547#comment-77958</guid>
		<description>informative at its best !!!</description>
		<content:encoded><![CDATA[<p>informative at its best !!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 50 Most Frequently Used UNIX / Linux Commands (With Examples)</title>
		<link>http://www.thegeekstuff.com/2009/12/4-ways-to-kill-a-process-kill-killall-pkill-xkill/comment-page-1/#comment-68988</link>
		<dc:creator>50 Most Frequently Used UNIX / Linux Commands (With Examples)</dc:creator>
		<pubDate>Mon, 08 Nov 2010 07:09:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=2547#comment-68988</guid>
		<description>[...] More kill examples: 4 Ways to Kill a Process – kill, killall, pkill, xkill [...]</description>
		<content:encoded><![CDATA[<p>[...] More kill examples: 4 Ways to Kill a Process – kill, killall, pkill, xkill [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://www.thegeekstuff.com/2009/12/4-ways-to-kill-a-process-kill-killall-pkill-xkill/comment-page-1/#comment-65213</link>
		<dc:creator>James</dc:creator>
		<pubDate>Mon, 04 Oct 2010 15:33:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=2547#comment-65213</guid>
		<description>Not all of these things work like I would expect on SuSE 11.3.  In particular, there seems to be issues killing things by name instead of PID, perhaps related to them being child processes.  For example, I can kill perl itself (which also kills any perl programs running) but I am frequently unable to kill just the program process without killing the perl interpreter.  Is there a reason for this?  It would be a lot more convenient to be able to kill by name than PID, but it just doesn&#039;t seem to work the same same.  In general, it tells me the process wasn&#039;t found, when I just grepped it and I know it&#039;s there.</description>
		<content:encoded><![CDATA[<p>Not all of these things work like I would expect on SuSE 11.3.  In particular, there seems to be issues killing things by name instead of PID, perhaps related to them being child processes.  For example, I can kill perl itself (which also kills any perl programs running) but I am frequently unable to kill just the program process without killing the perl interpreter.  Is there a reason for this?  It would be a lot more convenient to be able to kill by name than PID, but it just doesn&#8217;t seem to work the same same.  In general, it tells me the process wasn&#8217;t found, when I just grepped it and I know it&#8217;s there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bg, Fg, &#38;, Ctrl-Z &#8211; 5 Examples to Manage Unix Background Jobs</title>
		<link>http://www.thegeekstuff.com/2009/12/4-ways-to-kill-a-process-kill-killall-pkill-xkill/comment-page-1/#comment-45910</link>
		<dc:creator>Bg, Fg, &#38;, Ctrl-Z &#8211; 5 Examples to Manage Unix Background Jobs</dc:creator>
		<pubDate>Wed, 05 May 2010 06:03:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=2547#comment-45910</guid>
		<description>[...] To kill a foreground jobs, use one of the methods specified in our earlier article 4 Ways to Kill a Process &#8212; kill, killall, pkill, xkill. [...]</description>
		<content:encoded><![CDATA[<p>[...] To kill a foreground jobs, use one of the methods specified in our earlier article 4 Ways to Kill a Process &#8212; kill, killall, pkill, xkill. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Louis Watson</title>
		<link>http://www.thegeekstuff.com/2009/12/4-ways-to-kill-a-process-kill-killall-pkill-xkill/comment-page-1/#comment-39044</link>
		<dc:creator>Louis Watson</dc:creator>
		<pubDate>Fri, 12 Mar 2010 20:36:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=2547#comment-39044</guid>
		<description>Thank you for this - it was very helpful for a newbie like me !</description>
		<content:encoded><![CDATA[<p>Thank you for this &#8211; it was very helpful for a newbie like me !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabriel Rodriguez</title>
		<link>http://www.thegeekstuff.com/2009/12/4-ways-to-kill-a-process-kill-killall-pkill-xkill/comment-page-1/#comment-26791</link>
		<dc:creator>Gabriel Rodriguez</dc:creator>
		<pubDate>Sun, 20 Dec 2009 12:57:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.thegeekstuff.com/?p=2547#comment-26791</guid>
		<description>wow i didnt know you could do that, thanks a lot!!</description>
		<content:encoded><![CDATA[<p>wow i didnt know you could do that, thanks a lot!!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Content Delivery Network via Amazon Web Services: CloudFront: static.thegeekstuff.com

Served from: www.thegeekstuff.com @ 2012-02-09 13:20:07 -->
