2 .\" Copyright (c) 1999 Dag-Erling Coïdan Smørgrav
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
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.
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.
30 .Dd September 12, 2017
45 command lists open Internet or
49 The following options are available:
60 Show connected sockets.
62 Show only sockets belonging to the specified jail ID.
64 Only show Internet sockets if the local and foreign addresses are not
65 in the loopback network prefix
67 or do not contain the IPv6 loopback address
70 Show listening sockets.
72 Only show Internet sockets if the local or foreign port number
73 is on the specified list.
76 argument is a comma-separated list of port numbers and ranges
77 specified as first and last port separated by a dash.
79 Only show sockets of the specified
83 argument is a comma-separated list of protocol names,
84 as they are defined in
87 Display the protocol stack, if applicable.
88 This is currently only implemented for TCP.
90 Display the protocol state, if applicable.
91 This is currently only implemented for SCTP and TCP.
93 Display the remote UDP encapsulation port number, if applicable.
94 This is currently only implemented for SCTP.
108 will list sockets in all three domains.
116 will list both listening and connected sockets.
118 The information listed for each
120 .Bl -tag -width "FOREIGN ADDRESS"
122 The user who owns the socket.
124 The command which holds the socket.
126 The process ID of the command which holds the socket.
128 The file descriptor number of the socket.
130 The transport protocol associated with the socket for Internet
131 sockets, or the type of socket
132 .Pq stream, datagram, or seqpacket
137 For Internet sockets, this is the address the local end of the socket
139 .Xr getsockname 2 ) .
142 sockets, it is the socket's filename.
145 sockets, it is a right arrow followed by the endpoint's filename, or
147 if the endpoint could not be determined.
148 .It Li FOREIGN ADDRESS
149 (Internet sockets only)
150 The address the foreign end of the socket is bound to (see
151 .Xr getpeername 2 ) .
153 The remote UDP encapsulation port number if
155 is specified (only for SCTP).
159 is specified (only for SCTP).
161 The connection state if
163 is specified (only for SCTP or TCP).
165 The protocol stack if
167 is specified (only for TCP).
170 If a socket is associated with more than one file descriptor,
171 it is shown multiple times.
172 If a socket is not associated with any file descriptor,
173 the first four columns have no meaning.
189 command and this manual page were written by
190 .An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .