freebsd-questions Digest, Vol 767, Issue 2
walterp at gmail.com
Tue Feb 19 19:46:58 UTC 2019
> Message: 3
> Date: Mon, 18 Feb 2019 09:17:25 -0500
> From: "Kevin P. Neal" <kpn at neutralgood.org>
> To: BBlister <bblister at gmail.com>
> Cc: freebsd-questions at freebsd.org
> Subject: Re: Cannot identify process of listening port 600/tcp6
> Message-ID: <20190218141725.GA67494 at neutralgood.org>
> Content-Type: text/plain; charset=us-ascii
> On Mon, Feb 18, 2019 at 07:05:17AM -0700, BBlister wrote:
> > On the referenced URL, they are suggesting to use netstat -anp , which is
> > not applicable to FreeBSD (parameter -p is not valid). Also, they
> > to use ps.
> Have you tried lsof? You can lsof -n | grep TCP or lsof -n | grep UDP to
> find all processes that have any socket open. Use the "-n" option to lsof
> to so you can still grep for 600, otherwise you'll need to grep for
> "ipcserver" as shown in /etc/services.
> Have you tried sockstat? That command provides the output that a Linux
user would expect from netstat & -p. It works for IPv4, IPv6 and unix
sockets. Use sockstat -4 or sockstat -6 to see just IPv4 or IPv6 sockets.
>From the man page
The information listed for each socket is:
USER The user who owns the socket.
COMMAND The command which holds the socket.
PID The process ID of the command which holds the
FD The file descriptor number of the socket.
PROTO The transport protocol associated with the socket for
Internet sockets, or the type of socket
datagram, or seqpacket) for UNIX sockets.
LOCAL ADDRESS For Internet sockets, this is the address the local
of the socket is bound to (see getsockname(2)). For
bound UNIX sockets, it is the socket's filename. For
other UNIX sockets, it is a right arrow followed by
endpoint's filename, or "??" if the endpoint could not
The greatest dangers to liberty lurk in insidious encroachment by men of
zeal, well-meaning but without understanding. -- Justice Louis D. Brandeis
More information about the freebsd-questions