From owner-freebsd-questions Tue Feb 13 14:51:47 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail1.toronto.istar.net (mail1.toronto.istar.net [209.89.75.17]) by hub.freebsd.org (Postfix) with ESMTP id 7093A37B491 for ; Tue, 13 Feb 2001 14:51:42 -0800 (PST) Received: from d141-118-73.home.cgocable.net ([24.141.118.73]) by mail1.toronto.istar.net with esmtp (Exim 2.02 #1) id 14SoHe-0005DU-00; Tue, 13 Feb 2001 17:50:55 -0500 Date: Tue, 13 Feb 2001 17:41:31 -0500 (EST) From: Dru X-Sender: genisis@x1-6-00-00-b4-94-9d-3f.kico1.on.home.com To: Jason Hunt Cc: freebsd-questions@FreeBSD.ORG Subject: Re: netstat question. In-Reply-To: <3A89B8CA.F3023C25@niicommunications.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi Jason, Have you tried: sockstat -4 Cheers, Dru On Tue, 13 Feb 2001, Jason Hunt wrote: > greetings, > > in linux I am to list active connections with their pid, here is > an example of the output: > > netstat -anp > > Active Internet connections (servers and established) > Proto Recv-Q Send-Q Local Address Foreign Address State > PID/Program name > tcp 0 44 63.210.138.9:22 38.196.126.5:62859 ESTABLISHED > 1793/sshd2 > tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN > 369/sshd2 > tcp 0 0 0.0.0.0:5000 0.0.0.0:* LISTEN > 9708/vtund[s]: wait > raw 0 0 0.0.0.0:17 0.0.0.0:* 7 > 5834/portsentry > raw 0 0 0.0.0.0:6 0.0.0.0:* 7 > 5832/portsentry > raw 0 0 0.0.0.0:1 0.0.0.0:* 7 > - > raw 0 0 0.0.0.0:6 0.0.0.0:* 7 > - > Active UNIX domain sockets (servers and established) > Proto RefCnt Flags Type State I-Node PID/Program name > Path > unix 2 [ ] DGRAM 4590 5665/syslogd > /dev/log > unix 0 [ ] STREAM CONNECTED 52 93/klogd > @00000001 > unix 0 [ ] DGRAM 118672 369/sshd2 > unix 0 [ ] DGRAM 72571 9708/vtund[s]: wait > > > The great thing about this, was I could grep for a certain pid to find > out where the connection was coming from (samba connection for > example). Is there a way in FreeBSD to accomplish this? I looked > in the manpages and couldn't find any reference to PID's. Thanks > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message