Obtaining a pid or process owner from netstat?

Karol Kwiatkowski karol.kwiat at gmail.com
Thu Feb 1 01:24:17 UTC 2007


Glenn Gillis wrote:
> If 'netstat -anp tcp' shows me an IP address and port with a process
> listening on it, can anyone suggest a way to determine either the pid or
> the owner of the process that is bound to that address?
> 
> In other words:
> 
> % netstat -anp tcp | grep LISTEN
> tcp4       0      0  64.112.226.133.8091    *.*                   LISTEN
> tcp4       0      0  64.112.226.133.8090    *.*                   LISTEN
> tcp4       0      0  *.8021                 *.*                   LISTEN
> tcp4       0      0  *.8080                 *.*                   LISTEN
> tcp4       0      0  64.112.226.141.8080    *.*                   LISTEN
> tcp4       0      0  64.112.226.133.13080   *.*                   LISTEN
> 
> I'm interested in what is listening on 64.112.226.141.8080, mainly
> because I need something else to listen there. I know it's a Zope
> instance, but I can't tell *which* Zope instance (there are many on this
> box.)
> 
> NB: This is on a 4.11-RELEASE-p26 box.

Have a look at sockstat(1) and its options (like '-4' '-l' and '-p').

HTH,

Karol

-- 
Karol Kwiatkowski   <karol.kwiat at gmail dot com>
OpenPGP 0x06E09309

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20070201/48d4e271/signature.pgp


More information about the freebsd-questions mailing list