[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: network administration question



On Fri, Feb 15, 2002 at 04:15:05PM -0700, Theo de Raadt wrote:
> > Not sure this is what you want, but lsof in the ports will show you
> > the process name and PID that is associated with a port number.
> > 
> > So lsof -i shows you:
> > 
> > COMMAND   PID   USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
> > sshd    17767   root    3u  IPv6 0xe096c500      0t0  TCP *:ssh (LISTEN)
> 
> No need to install some dumb package
> 
> % fstat | grep '*:22'
> root     sshd       21156    3* internet6 stream tcp 0xe179ec78 *:22
> root     sshd       21156    4* internet stream tcp 0xe179ed5c *:22

Thanx. fstat(1) is the one.
Here is my silly attempt to excuse me for not finding it;)
i did   man -k ps
	man -k pid
	man -k process
	man -k socket
but fstat(1) didn't show up. So i looked at the manpages of ps(1), pstat(8),
netstat(1) but fstat was not mentioned in the SEE ALSO -section of these
manpages. Maybe someone can put it there so dumbasses like myself can find
it on their own?

Thanks again for your help!

Alf


Visit your host, monkey.org