<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mindtonic &#187; Unix</title>
	<atom:link href="http://blog.mindtonic.net/category/development/unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mindtonic.net</link>
	<description>Thoughts on Music and Application Development</description>
	<lastBuildDate>Fri, 30 Jul 2010 18:08:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Working With Server Processes</title>
		<link>http://blog.mindtonic.net/listing-all-running-processes-on-the-server/</link>
		<comments>http://blog.mindtonic.net/listing-all-running-processes-on-the-server/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 23:15:13 +0000</pubDate>
		<dc:creator>mindtonic</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://blog.mindtonic.net/listing-all-running-processes-on-the-server/</guid>
		<description><![CDATA[A simple little entry, I know, but a powerful tool to use and remember! Display full information about each of the processes currently running.: ps -ef Output: UID PID PPID C STIME TTY TIME CMD hope 29197 18961 0 Sep27 ? 00:00:06 sshd: hope@pts/87 hope 32097 29197 0 Sep27 pts/87 00:00:00 -csh hope 7209 32097 [...]]]></description>
			<content:encoded><![CDATA[<p>A simple little entry, I know, but a powerful tool to use and remember!</p>
<p>Display full information about each of the processes currently running.:</p>
<p><code>ps -ef</code></p>
<p>Output:<br />
<code>UID PID PPID C STIME TTY TIME CMD</code><br />
<code>hope 29197 18961 0 Sep27 ? 00:00:06 sshd: hope@pts/87</code><br />
<code>hope 32097 29197 0 Sep27 pts/87 00:00:00 -csh</code><br />
<code>hope 7209 32097 0 12:17 pts/87 00:00:00 ps -ef</code></p>
<p>To see just Ruby processes:</p>
<p><code>ps -ef | grep ruby</code></p>
<p><strong>How to Kill Processes for a User</strong></p>
<p>I had a BackgrounDRb process that just wouldn&#8217;t give it up, for a month, really!  When all else failed, this worked:</p>
<p><code>kill -9 `ps -u username | grep -v PID | awk '{ printf ("%s ", $1); }'`</code></p>
<p>Replace username with the actual user name.  <em>Of course you should only use the -9 option when you really have to.</em></p>
<p><strong>The New Way</strong></p>
<p>Instead of going through all of that, you can simply use the pkill command if you already know the process name or part of it.</p>
<p><code>$ pkill packet_worker_runner</code></p>
<p>It’s as simple as that. You should note that pkill will kill all processes matching the search text, in this case backgroundrb processes which can be identified by the packet_worker_runner process name.</p>
<p>If you want to see what process names are matched before using the pkill command, you can use the ps command as described above.</p>
<p><code>$ ps -ef | grep packet_worker_runner</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mindtonic.net/listing-all-running-processes-on-the-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
