From owner-freebsd-questions Tue May 23 16:35:39 2000 Delivered-To: freebsd-questions@freebsd.org Received: from firehouse.net (rdu25-28-186.nc.rr.com [24.25.28.186]) by hub.freebsd.org (Postfix) with SMTP id C6D3637B5C7 for ; Tue, 23 May 2000 16:35:35 -0700 (PDT) (envelope-from abc@firehouse.net) Received: (qmail 57430 invoked by uid 1000); 23 May 2000 23:35:34 -0000 Date: Tue, 23 May 2000 19:35:34 -0400 From: Alan Clegg To: David Kirchner Cc: Oscar Ricardo Silva , freebsd-questions@FreeBSD.ORG Subject: Re: Port 722 ? Message-ID: <20000523193534.A57347@ecto.greenpeas.org> References: <4.2.2.20000523180523.00a8f680@mail.utexas.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: ; from dpk@nwserv.com on Tue, May 23, 2000 at 04:27:00PM -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Out of the ether, David Kirchner spewed forth the following bitstream: > An easy way to find out what an unknown port is: > > First run 'netstat -aAn | grep LISTEN | grep \.portnum'. The -A flag will > display the address for the socket. You can then figure out which process > is using that address by running 'fstat | grep address': > > dpk@web2:/home/dpk$ netstat -aAn | grep LISTEN | grep \.25 > c6400180 tcp 0 0 *.25 *.* LISTEN > dpk@web2:/home/dpk$ fstat | grep c6400180 > root sendmail 94903 4* internet stream tcp c6400180 Easier way: lsof -i TCP:_portnum_ ecto 101} /usr/local/sbin/lsof -i TCP:25 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME tcpserver 381 qmaild 3u IPv4 0xc735c500 0t0 TCP *:smtp (LISTEN) lsof from ports, btw... AlanC -- \ Alan B. Clegg Just because I can \ abc@firehouse.net does not mean I will. \ \ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message