ss命令 – 显示活动套接字信息
| 将原始TCP套接字信息转储到文件 | **参考实例** 显示TCP套接字: ``` [root@anycode ~]# ss -t -a State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 0.0.0.0:ssh 0.0.0.0:* ESTAB 0 52 192.168.60.19:ssh 192.168.30.21:59321 LISTEN 0 128 *:websm *:* LISTEN 0 128 [::]:ssh [::]:* ``` 显示UDP套接字: ``` [root@anycode ~]# ss -u -a State Recv-Q Send-Q Local Address:Port Peer Address:Port UNCONN 0 0 0.0.0.0:bootpc 0.0.0.0:* UNCONN 0 0 127.0.0.1:323 0.0.0.0:* UNCONN 0 0 [::1]:323 [::]:* ``` 显示套接字使用概况: ``` [root@anycode ~]# ss -s Total: 185 TCP: 4 (estab 1, closed 0, orphaned 0, timewait 0) Transport Total IP IPv6 RAW 1 0 1 UDP 3 2 1 TCP 4 2 2 INET 8 4 4 FRAG 0 0 0 ```