<?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>gHacks technology news &#187; process status</title>
	<atom:link href="http://www.ghacks.net/tag/process-status/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghacks.net</link>
	<description>A technology blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description>
	<lastBuildDate>Tue, 24 Nov 2009 23:31:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Get to know Linux: ps command</title>
		<link>http://www.ghacks.net/2009/07/01/get-to-know-linux-ps-command/</link>
		<comments>http://www.ghacks.net/2009/07/01/get-to-know-linux-ps-command/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 00:04:35 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[process status]]></category>
		<category><![CDATA[processes]]></category>
		<category><![CDATA[ps]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=14023</guid>
		<description><![CDATA[Over the years there have been certain commands that have really helped me out of a bind. One of those commands is the ps command. The ps stands for process status and it tells you, as you would expect, the status of a process. This is a fast way to know if an application or [...]]]></description>
			<content:encoded><![CDATA[<p>Over the years there have been certain commands that have really helped me out of a bind. One of those commands is the <em>ps</em> command. The <em>ps </em>stands for <em>process status</em> and it tells you, as you would expect, the status of a process. This is a fast way to know if an application or command is running on a Linux system. Oh sure you could fire up a swell GUI for the same purpose, but that GUI does you no good if you are working on a headless server installation or working on a remote machine. In those instances the <em>ps </em>command is your best bet for helping to manage processes.</p>
<p>You will be glad to know that the <em>ps</em> command will most certainly be already installed on your Linux machine, so there is no need to worry about installation.</p>
<p><span id="more-14023"></span><strong>Command structure</strong></p>
<p>The basic command structure for <em>ps </em>is:</p>
<p>ps OPTION</p>
<p>Of course every good Linux command offers a lot of options, and <em>ps</em> is no exception. For this command we will just outline the best groupings of options together instead of just listing all of (or the best) options. This way you can skip right down to the command you need to use.</p>
<p><strong>Show list of processes owned by a specific user</strong></p>
<p>Say I want to list all processes owned by user <em>jlwallen</em>. To do this I could enter one of two commands:</p>
<p><em>ps ux</em></p>
<p>This will list out all processes that are owned by the user issuing the command. The results for this command will look like:</p>
<p><code>USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND<br />
jlwallen   560  0.0  0.3  18312  7376 ?        SNs  19:40   0:00 /etc/alternativ<br />
jlwallen   561  0.0  0.1   7316  3932 pts/0    SNs  19:40   0:00 bash<br />
jlwallen  1137  0.0  0.0   1644   416 ?        S    19:47   0:00 sleep 8<br />
jlwallen  1141  0.0  0.0   1644   420 ?        S    19:47   0:00 sleep 8<br />
jlwallen  1142  0.0  0.0   4384  1012 pts/0    RN+  19:48   0:00 ps ux</code></p>
<p>You can also get a similar listing with the command:</p>
<p><em>ps U jlwallen</em></p>
<p>The results of this command will be:</p>
<p><code>PID TTY      STAT   TIME COMMAND<br />
560 ?        SNs    0:00 /etc/alternatives/x-terminal-emulator<br />
561 pts/0    SNs    0:00 bash<br />
1223 ?        S      0:00 sleep 8<br />
1227 ?        S      0:00 sleep 8<br />
1228 pts/0    RN+    0:00 ps U jlwallen</code></p>
<p><strong>Show all processes</strong></p>
<p>To see every process on your system you would enter the command:</p>
<p><em>ps aux</em></p>
<p>The results of this command would look similar to that of <em>ps ux</em> only it would show the process of every user as well as the system.</p>
<p><strong>List the details of a single process</strong></p>
<p>What about when you want to see the details of only a single process? Imagine issuing the command <em>ps ux</em> and having to search through all of the listings to find the information about the one process you are trying to gain information about. Say, for example, you need to find the PID (Process ID) of the currently running daemon for Dansguardian. You can use the <em>ps</em> command and pipe the results to the <em>grep</em> command to search the listing for a specific string and print out only the matching strings. To do this issue the command:</p>
<p><em>ps aux | grep dansguardian</em></p>
<p>which will print out something like:</p>
<p><code>113       2596  0.0  0.5  17852 11460 ?        Ss   06:49   0:00 /usr/sbin/dansguardian</code></p>
<p>Now you can see the PID of Dansguardian is 2596. You can kill this with the <em>kill 2956 </em>command.</p>
<p><strong>Final thoughts</strong></p>
<p>There are many more uses for the <em>ps</em> command as well as many more ways to use the <em>ps </em>command. The above three examples are the most often used, but don&#8217;t think you are limited to only those uses. Issue the command <em>man ps</em> and you will see a full listing of all the <em>ps</em> options available to you.</p>

	Tags: <a href="http://www.ghacks.net/tag/process-status/" title="process status" rel="tag">process status</a>, <a href="http://www.ghacks.net/tag/processes/" title="processes" rel="tag">processes</a>, <a href="http://www.ghacks.net/tag/ps/" title="ps" rel="tag">ps</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/06/09/windows-task-manager-replacement-dtaskmanager/" title="Windows Task Manager Replacement DTaskManager (June 9, 2009)">Windows Task Manager Replacement DTaskManager</a> (7)</li>
	<li><a href="http://www.ghacks.net/2006/02/13/what-is-that-file/" title="What is that file ? (February 13, 2006)">What is that file ?</a> (0)</li>
	<li><a href="http://www.ghacks.net/2006/06/26/what-is-running-on-my-system/" title="What is running on my system ? (June 26, 2006)">What is running on my system ?</a> (0)</li>
	<li><a href="http://www.ghacks.net/2008/02/23/vssvcexe/" title="Vssvc.exe (February 23, 2008)">Vssvc.exe</a> (8)</li>
	<li><a href="http://www.ghacks.net/2005/10/25/process-patrol/" title="Process Patrol (October 25, 2005)">Process Patrol</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/07/01/get-to-know-linux-ps-command/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
