<?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: Find out which process is holding which socket open</title>
	<atom:link href="http://www.tech-recipes.com/rx/227/find-out-which-process-is-holding-which-socket-open/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tech-recipes.com/rx/227/find-out-which-process-is-holding-which-socket-open/</link>
	<description>Computer and technology tutorials and guides</description>
	<lastBuildDate>Sat, 21 Nov 2009 20:38:45 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Guest</title>
		<link>http://www.tech-recipes.com/rx/227/find-out-which-process-is-holding-which-socket-open/comment-page-1/#comment-403</link>
		<dc:creator>Guest</dc:creator>
		<pubDate>Tue, 17 Aug 2004 20:02:54 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-403</guid>
		<description>Just use /usr/proc/bin/pfiles &lt;pid&gt;   bit of a pain to do it in reverse (i.e. speicfy pid to get the port) but a simple script can rip thru it for you....

echo &quot;which port?&gt; &quot;
read port

for pid in `ps -ef -o pid &#124; tail +2`
do
        foundport=`/usr/proc/bin/pfiles $pid 2&gt;&amp;1 &#124; grep &quot;sockname:&quot; &#124; grep &quot;por
t: $port$&quot;`
        if [ &quot;$foundport&quot; != &quot;&quot; ]
        then
                echo &quot;proc: $pid, $foundport&quot;
        fi
done</description>
		<content:encoded><![CDATA[<p>Just use /usr/proc/bin/pfiles &lt;pid&gt;   bit of a pain to do it in reverse (i.e. speicfy pid to get the port) but a simple script can rip thru it for you&#8230;.</p>
<p>echo &#8220;which port?&gt; &#8221;<br />
read port</p>
<p>for pid in `ps -ef -o pid | tail +2`<br />
do<br />
        foundport=`/usr/proc/bin/pfiles $pid 2&gt;&amp;1 | grep &#8220;sockname:&#8221; | grep &#8220;por<br />
t: $port$&#8221;`<br />
        if [ "$foundport" != "" ]<br />
        then<br />
                echo &#8220;proc: $pid, $foundport&#8221;<br />
        fi<br />
done</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.tech-recipes.com/rx/227/find-out-which-process-is-holding-which-socket-open/comment-page-1/#comment-210</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 15 Jun 2004 09:35:05 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-210</guid>
		<description>netstat -anp works on linux, but not Solaris :-(</description>
		<content:encoded><![CDATA[<p>netstat -anp works on linux, but not Solaris :-(</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.tech-recipes.com/rx/227/find-out-which-process-is-holding-which-socket-open/comment-page-1/#comment-51</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Wed, 07 Jan 2004 12:41:02 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-51</guid>
		<description>Actually, you can skip a whole step there... if you add the &#039;-p&#039; argument to netstat, it includes the PID of the process in question!

So instead of netstat -an, try netstat -anp.</description>
		<content:encoded><![CDATA[<p>Actually, you can skip a whole step there&#8230; if you add the &#8216;-p&#8217; argument to netstat, it includes the PID of the process in question!</p>
<p>So instead of netstat -an, try netstat -anp.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
