Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jun 2002 15:17:02 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Varshavchick Alexander <alex@metrocom.ru>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Getting pid of listening process
Message-ID:  <20020619121702.GB45894@hades.hell.gr>
In-Reply-To: <Pine.GSO.4.21.0206191131230.7233-100000@apache.metrocom.ru>
References:  <Pine.GSO.4.21.0206191131230.7233-100000@apache.metrocom.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2002-06-19 11:37 +0000, Varshavchick Alexander wrote:
> Hi gurus,
> 
> can anybody make a hint as how pid of a process listening on a specified
> tcp port can be determined?

$ sockstat -l4 | grep ':25 ' | awk '{print $3}'
21401
493

$ ps xa | grep 21401 | grep -v grep
21401  ??  Ss     0:06.14 sendmail: accepting connections (sendmail)

$ ps xa | grep 493 | grep -v grep
  493  ??  Ss     0:09.91 sendmail: accepting connections (sendmail)

- Giorgos


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020619121702.GB45894>