command to inentify the process that is listening in a port.

Tom Evans tevans.uk at googlemail.com
Wed May 9 14:40:15 UTC 2007


On Wed, 2007-04-11 at 14:52 -0400, Bob Johnson wrote:
> On 4/10/07, Jonathan McKeown <jonathan at hst.org.za> wrote:
> > On Monday 09 April 2007 17:37, Martin Hudec wrote:
> > > Siju George wrote:
> > > > How Do you actually Identify what process is listening on a TCP/IP port?
> > > > "nmap" does not usually give the right answer.
> > > > There should be some command that can be run on the local host for
> > > > identification right?
> > >
> > > man lsof
> > >
> > > 5:35pm [amber] ~# lsof -i @localhost:123
> > > COMMAND PID USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
> > > ntpd    552 root   10u  IPv4 0xc4c46000      0t0  UDP localhost:ntp
> >
> > Just out of interest, why do so many people recommend lsof, which is a port,
> > when sockstat/fstat are in the base system and seem to cover the same
> > ground?
> > Am I missing something about lsof?
> 
> Linux systems don't have sockstat, so people who got to FreeBSD via
> Linux are used to lsof and they tend to continue using it. Same result
> for those who read the many Linux howto websites.
> 
> - Bob
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"

Ironically, coming from linux I found that FreeBSD netstat doesn't
support the -l -4 flags, which is how I found out about sockstat -l4 :)

Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20070509/f93ca714/attachment.pgp


More information about the freebsd-questions mailing list