3 ss \- another utility to investigate sockets
6 .RI [ options ] " [ FILTER ]"
9 is used to dump socket statistics. It allows showing information similar
12 It can display more TCP and state informations than other tools.
15 When no option is used ss displays a list of
16 open non-listening sockets (e.g. TCP/UNIX/UDP) that have established connection.
19 Show summary of options.
22 Output version information.
28 Do not try to resolve service names.
31 Try to resolve numeric address/ports.
34 Display both listening and non-listening (for TCP this means established connections) sockets.
37 Display only listening sockets (these are omitted by default).
40 Show timer information.
43 Show detailed socket information
46 Show socket memory usage.
49 Show process using socket.
52 Show internal TCP information.
55 Attempts to forcibly close sockets. This option displays sockets that are
56 successfully closed and silently skips sockets that the kernel does not support
57 closing. It supports IPv4 and IPv6 sockets only.
60 Print summary statistics. This option does not parse socket lists obtaining
61 summary from various sources. It is useful when amount of sockets is so huge
62 that parsing /proc/net/tcp is painful.
67 option but also shows process security context.
71 sockets the initiating process context is displayed as follows:
75 If valid pid show the process context.
77 If destination is kernel (pid = 0) show kernel initial context.
79 If a unique identifier has been allocated by the kernel or netlink user,
80 show context as "unavailable". This will generally indicate that a
81 process has more than one netlink socket active.
88 option but also shows the socket context. The socket context is
89 taken from the associated inode and is not the actual socket
90 context held by the kernel. Sockets are typically labeled with the
91 context of the creating process, however the context shown will reflect
92 any policy role, type and/or range transition rules applied,
93 and is therefore a useful reference.
95 .B \-N NSNAME, \-\-net=NSNAME
96 Switch to the specified network namespace name.
99 Show socket BPF filters (only administrators are allowed to get these information).
102 Display only IP version 4 sockets (alias for -f inet).
105 Display only IP version 6 sockets (alias for -f inet6).
108 Display PACKET sockets (alias for -f link).
117 Display DCCP sockets.
123 Display Unix domain sockets (alias for -f unix).
126 Display SCTP sockets.
128 .B \-f FAMILY, \-\-family=FAMILY
129 Display sockets of type FAMILY.
130 Currently the following families are supported: unix, inet, inet6, link, netlink.
132 .B \-A QUERY, \-\-query=QUERY, \-\-socket=QUERY
133 List of socket tables to dump, separated by commas. The following identifiers
134 are understood: all, inet, tcp, udp, raw, unix, packet, netlink, unix_dgram,
135 unix_stream, unix_seqpacket, packet_raw, packet_dgram, dccp, sctp.
137 .B \-D FILE, \-\-diag=FILE
138 Do not display anything, just dump raw information about TCP sockets to FILE after applying filters. If FILE is - stdout is used.
140 .B \-F FILE, \-\-filter=FILE
141 Read filter information from FILE.
142 Each line of FILE is interpreted like single command line option. If FILE is - stdin is used.
144 .B FILTER := [ state STATE-FILTER ] [ EXPRESSION ]
145 Please take a look at the official documentation (Debian package iproute-doc) for details regarding filters.
150 allows to construct arbitrary set of states to match. Its syntax is sequence of keywords state and exclude followed by identifier of state.
152 Available identifiers are:
154 All standard TCP states:
155 .BR established ", " syn-sent ", " syn-recv ", " fin-wait-1 ", " fin-wait-2 ", " time-wait ", " closed ", " close-wait ", " last-ack ", "
156 .BR listening " and " closing.
162 - all the states except for
163 .BR listening " and " closed
172 - states, which are maintained as minisockets, i.e.
173 .BR time-wait " and " syn-recv
182 Display all TCP sockets.
185 Display all TCP sockets with process SELinux security contexts.
188 Display all UDP sockets.
190 .B ss -o state established '( dport = :ssh or sport = :ssh )'
191 Display all established ssh connections.
193 .B ss -x src /tmp/.X11-unix/*
194 Find all local processes connected to X server.
196 .B ss -o state fin-wait-1 '( sport = :http or sport = :https )' dst 193.233.7/24
197 List all the tcp sockets in state FIN-WAIT-1 for our apache to network 193.233.7/24 and look at their timers.
200 .BR /usr/share/doc/iproute-doc/ss.html " (package iprouteĀdoc)",
203 - https://tools.ietf.org/rfc/rfc793.txt (TCP states)
207 was written by Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>.
209 This manual page was written by Michael Prokop <mika@grml.org>
210 for the Debian project (but may be used by others).