From owner-freebsd-questions Tue Feb 13 14:44:44 2001 Delivered-To: freebsd-questions@freebsd.org Received: from hermes.niicommunications.com (hermes.niicommunications.com [38.196.126.26]) by hub.freebsd.org (Postfix) with ESMTP id B3BE437B69D for ; Tue, 13 Feb 2001 14:44:28 -0800 (PST) Received: from niicommunications.com (xerxes.niicommunications.com [192.168.2.225]) by hermes.niicommunications.com (8.11.1/8.11.1) with ESMTP id f1DMiR919900 for ; Tue, 13 Feb 2001 16:44:27 -0600 (CST) (envelope-from jason.hunt@niicommunications.com) Message-ID: <3A89B8CA.F3023C25@niicommunications.com> Date: Tue, 13 Feb 2001 16:44:27 -0600 From: Jason Hunt X-Mailer: Mozilla 4.76 [en] (X11; U; FreeBSD 4.2-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: netstat question. Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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