Re: Port-Numbers

J. Sean Connell (ankh@canuck.gen.nz)
Sat, 8 Mar 1997 22:03:48 +1300 (NZDT)


On Wed, 15 Jan 1997 mab@hamburg.GermanLloyd.de wrote:

> Hi *,
>
> I know this is a little bit offtopic, but I don't have anyone else to ask!
>
> How can I get the PID of a process waiting for a connection on a
> specific port-number? I can see with 'netstat -a' that there is
> _someone_ sitting on it, but I can not see _who_!

I realize that this reply is about two months old, but I hope it's still of
some use to you.

The fuser program in the most recent psmisc package (psmisc-12 on my RH4.0
box) will let you do that, by using a command like:

fuser -n tcp 143
^^^ ^^^
| +---- port number
+-------- protocol (tcp, udp, etc.)

HTH!

--
Jeffrey Connell            | Systems Adminstrator, ICONZ
ankh@canuck.gen.nz         | Any opinions stated above are not my employers',
ankh@iconz.co.nz           | not my boyfriend's, my priest's, my God's, my
#include <stddisc.h>       | my friends', and probably not even my own.
---------------------------+--------------------------------------------------
Fingerprint: 1024/2B8B116D | Key at http://www.canuck.gen.nz/~ankh/pgpkey.html