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