From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu Subject: Re: [9fans] equivalent of fstat | grep $portnumber ? Date: Tue, 19 Jun 2007 08:39:24 -0700 From: Skip Tavakkolian <9nut@9netics.com> In-Reply-To: <20070619152735.GB6960@pestilenz.org> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 81d083e0-ead2-11e9-9d60-3106f5b1d025 > Hi all, > what would be the Plan9 way of finding the process that > listens on a given port number? Grepping through /proc > does not help afaics because only /net/tcp/clone is > opened while listening (?). > > Thanks, > > Matthias something like this? cpu% netstat | grep https tcp 25 none Listen https 0 :: cpu% grep '/net/tcp/25' /proc/*/fd /proc/8429/fd: 13 rw I 0 (000000000002040c 0 00) 0 2 /net/tcp/25/listen cpu% ps -eaf|grep 8429 none 8429 0:00 0:00 1404K Pread httpd ? fst 17202 0:00 0:00 156K Pread grep 8429 cpu%