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.Os FreeBSD 33.Sh NAME 34.Nm sockstat 35.Nd list open sockets 36.Sh SYNOPSIS 37.Nm 38.Op Fl 46clu 39.Sh DESCRIPTION 40The 41.Nm 42command lists open Internet or Unix domain sockets. 43.Pp 44The following options are available: 45.Bl -tag -width Fl 46.It Fl 4 47Show AF_INET (IPv4) sockets. 48.It Fl 6 49Show AF_INET6 (IPv6) sockets. 50.It Fl c 51Show connected sockets. 52.It Fl l 53Show listening sockets. 54.It Fl u 55Show AF_LOCAL (Unix) sockets. 56.El 57.Pp 58If neither 59.Fl 4 , 60.Fl 6 61or 62.Fl u 63is specified, 64.Nm 65will list sockets in all three domains. 66.Pp 67If neither 68.Fl c 69or 70.Fl l 71is specified, 72.Nm 73will list both listening and connected sockets. 74.Pp 75The information listed for each 76socket is: 77.Bl -tag -width "FOREIGN ADDRESS" 78.It Li USER 79The user who owns the socket. 80.It Li COMMAND 81The command which holds the socket. 82.It Li PID 83The process ID of the command which holds the socket. 84.It Li FD 85The file descriptor number of the socket. 86.It Li PROTO 87The transport protocol associated with the socket for Internet 88sockets, or the type of socket (stream or datagram) for Unix sockets. 89.It Li ADDRESS 90(Unix sockets only) 91For bound sockets, this is the filename of the socket. 92For other sockets, it is the name, PID and file descriptor number of 93the peer, or "(none)" if the socket is neither bound nor connected. 94.It Li LOCAL ADDRESS 95(Internet sockets only) 96The address the local end of the socket is bound to (see 97.Xr getsockname 2 ) . 98.It Li FOREIGN ADDRESS 99(Internet sockets only) 100The address the foreign end of the socket is bound to (see 101.Xr getpeername 2 ) . 102.El 103.Sh SEE ALSO 104.Xr fstat 1 , 105.Xr netstat 1 , 106.Xr inet 4 , 107.Xr inet6 4 108.Sh HISTORY 109The 110.Nm 111command appeared in 112.Fx 3.1 . 113.Sh AUTHORS 114The 115.Nm 116command and this manual page were written by 117.An Dag-Erling Sm\(/orgrav Aq des@freebsd.org . 118