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 TCP sockets that have established connection.
19 Show summary of options.
22 Output version information.
25 Do not try to resolve service names.
28 Try to resolve numeric address/ports.
31 Display both listening and non-listening (for TCP this means established connections) sockets.
34 Display only listening sockets (these are omitted by default).
37 Show timer information.
40 Show detailed socket information
43 Show socket memory usage.
46 Show process using socket.
49 Show internal TCP information.
52 Print summary statistics. This option does not parse socket lists obtaining
53 summary from various sources. It is useful when amount of sockets is so huge
54 that parsing /proc/net/tcp is painful.
59 option but also shows process security context.
63 sockets the initiating process context is displayed as follows:
67 If valid pid show the process context.
69 If destination is kernel (pid = 0) show kernel initial context.
71 If a unique identifier has been allocated by the kernel or netlink user,
72 show context as "unavailable". This will generally indicate that a
73 process has more than one netlink socket active.
80 option but also shows the socket context. The socket context is
81 taken from the associated inode and is not the actual socket
82 context held by the kernel. Sockets are typically labeled with the
83 context of the creating process, however the context shown will reflect
84 any policy role, type and/or range transition rules applied,
85 and is therefore a useful reference.
87 .B \-N NSNAME, \-\-net=NSNAME
88 Switch to the specified network namespace name.
91 Show socket BPF filters (only administrators are allowed to get these information).
94 Display only IP version 4 sockets (alias for -f inet).
97 Display only IP version 6 sockets (alias for -f inet6).
100 Display PACKET sockets (alias for -f link).
109 Display DCCP sockets.
115 Display Unix domain sockets (alias for -f unix).
117 .B \-f FAMILY, \-\-family=FAMILY
118 Display sockets of type FAMILY.
119 Currently the following families are supported: unix, inet, inet6, link, netlink.
121 .B \-A QUERY, \-\-query=QUERY, \-\-socket=QUERY
122 List of socket tables to dump, separated by commas. The following identifiers
123 are understood: all, inet, tcp, udp, raw, unix, packet, netlink, unix_dgram,
124 unix_stream, unix_seqpacket, packet_raw, packet_dgram.
126 .B \-D FILE, \-\-diag=FILE
127 Do not display anything, just dump raw information about TCP sockets to FILE after applying filters. If FILE is - stdout is used.
129 .B \-F FILE, \-\-filter=FILE
130 Read filter information from FILE.
131 Each line of FILE is interpreted like single command line option. If FILE is - stdin is used.
133 .B FILTER := [ state STATE-FILTER ] [ EXPRESSION ]
134 Please take a look at the official documentation (Debian package iproute-doc) for details regarding filters.
139 allows to construct arbitrary set of states to match. Its syntax is sequence of keywords state and exclude followed by identifier of state.
141 Available identifiers are:
143 All standard TCP states:
144 .BR established ", " syn-sent ", " syn-recv ", " fin-wait-1 ", " fin-wait-2 ", " time-wait ", " closed ", " close-wait ", " last-ack ", "
145 .BR listen " and " closing.
151 - all the states except for
152 .BR listen " and " closed
161 - states, which are maintained as minisockets, i.e.
162 .BR time-wait " and " syn-recv
171 Display all TCP sockets.
174 Display all TCP sockets with process SELinux security contexts.
177 Display all UDP sockets.
179 .B ss -o state established '( dport = :ssh or sport = :ssh )'
180 Display all established ssh connections.
182 .B ss -x src /tmp/.X11-unix/*
183 Find all local processes connected to X server.
185 .B ss -o state fin-wait-1 '( sport = :http or sport = :https )' dst 193.233.7/24
186 List all the tcp sockets in state FIN-WAIT-1 for our apache to network 193.233.7/24 and look at their timers.
189 .BR /usr/share/doc/iproute-doc/ss.html " (package iprouteĀdoc)",
192 - https://tools.ietf.org/rfc/rfc793.txt (TCP states)
196 was written by Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>.
198 This manual page was written by Michael Prokop <mika@grml.org>
199 for the Debian project (but may be used by others).