1.\"- 2.\" Copyright (c) 1999 Dag-Erling Co�dan Sm�rgrav 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer 10.\" in this position and unchanged. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. The name of the author may not be used to endorse or promote products 15.\" derived from this software without specific prior written permission. 16.\" 17.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27.\" 28.\" $FreeBSD$ 29.\" 30.Dd April 13, 1999 31.Dt SOCKSTAT 1 32.Sh NAME 33.Nm sockstat 34.Nd list open sockets 35.Sh SYNOPSIS 36.Nm 37.Op Fl 46u 38.Sh DESCRIPTION 39The 40.Nm 41command lists open Internet or Unix domain sockets. 42.Pp 43The following options are available: 44.Bl -tag -width Fl 45.It Fl 4 46Show AF_INET (IPv4) sockets. 47.It Fl 6 48Show AF_INET6 (IPv6) sockets. 49.It Fl u 50Show AF_LOCAL (Unix) sockets. 51.El 52.Pp 53If no option is specified, 54.Nm 55will list sockets of all three types. 56.Pp 57The information listed for each 58socket is: 59.Bl -tag -width "FOREIGN ADDRESS" 60.It Li USER 61The user who owns the socket. 62.It Li COMMAND 63The command which holds the socket. 64.It Li PID 65The process ID of the command which holds the socket. 66.It Li FD 67The file descriptor number of the socket. 68.It Li PROTO 69The transport protocol associated with the socket for Internet 70sockets, or the type of socket (stream or datagram) for Unix sockets. 71.It Li ADDRESS 72(Unix sockets only) 73For listening sockets, this is the filename of the socket. 74For other sockets, it is the name, PID and file descriptor number of 75the peer, or "(none)" if the socket is neither bound nor connected. 76.It Li LOCAL ADDRESS 77(Internet sockets only) 78The address the local end of the socket is bound to (see 79.Xr getsockname 2 ). 80.It Li FOREIGN ADDRESS 81(Internet sockets only) 82The address the foreign end of the socket is bound to (see 83.Xr getpeername 2 ). 84.El 85.Sh SEE ALSO 86.Xr fstat 1 , 87.Xr netstat 1 , 88.Xr inet 4 , 89.Xr inet6 4 90.Sh HISTORY 91The 92.Nm 93command appeared in 94.Fx 3.1 . 95.Sh AUTHORS 96The 97.Nm 98command and this manual page were written by 99.An Dag-Erling Sm�rgrav Aq des@freebsd.org . 100