Command format
SS [Options] [ FILTER ]
Command parameters
-H,--help
Displays help information.
-V,--version
Displays version information.
-N,--numeric
The service name is not resolved.
-R,--resolve
Try to parse the address and port in digital form.
-A,--all
All sockets are displayed.
-L,--listening
Displays the sockets for all listening states.
-O,--options
Displays timer information.
-E,--extended
Displays detailed socket information.
-M,--memory
Displays memory usage for sockets.
-P,--processes
Displays processes that use sockets.
-I.,--info
Only TCP information is displayed.
-S,--summary
Displays statistics.
-4,--ipv4
Only IPV4 sockets are displayed, equivalent to the-F inet option.
-6,--ipv6
Only IPV6 sockets are displayed, equivalent to the-f inet6 option.
-0,--packet
Only PACKET sockets are displayed.
-T,--tcp
Only TCP sockets are displayed.
-U,--UDP
Only UDP sockets are displayed.
-D,--DCCP
Only DCCP sockets are displayed.
-W,--raw
Only RAW sockets are displayed.
-X,--unix
Only the sockets for Unix domains are displayed.
-F FAMILY,--family=family
Displays the FAMILY type of socket. Currently supported types are UNIX, inet, Inet6, Link, netlink.
-D FILE,--diag=file
does not display any information to dump the original TCP socket information to the specified file.
-F FILE,--filter=file
Reads the filter information from the specified file.
Instance
A) View all TCP connections
Ss-t -A State recv-q send-q Local address:port Peer address:port LISTEN 0 ::: Eforward :::* LISTEN 0 :: 22181:: :* LISTEN 0:: : 25992 :::* LISTEN 0 : : ffff:127.0.0.1:9160 :::* LISTEN 0 :: FFFF : 10.1.228.166:9160 :::* LISTEN 0 fe80::43a:faff:fe00:11e:9160 :::* LISTEN 0 : : 1:9160 :::* LISTEN 0:: : mysql :::* LISTEN 0 *:6379 *:*
...
b) Displays the process information for the socket using the listening state.
SS-PL Recv-q send-q Local address:port Peer address:port 0 ::: eforward :::* 0 50 ::: 22181 :::* 0-:: 25992 :::* 0 :: ffff:127.0.0.1:9160 :::* 0 ffff:10.1.228.166:9160:: £ º: :* 0 fe80::43a:faff:fe00 : 11e:9160 :::* 0--: 1:9160 :::* 0::: mysql :::* 0 *:6379 *:* Users: (("Redis-server", 43172,5) ...
c) Displays the statistics for the socket.
ss-s total:421 (kernel 458) TCP: 193 (estab, closed, orphaned 0, synrecv 0, timewait 55/0), ports 182Transport total< C2/>ip ipv6* 458 - - RAW 0 0 0 UDP 7 8 TCP 135 124 INET FRAG 0 0
Linux command-SS: View socket Statistics