ss,它是 iproute2 包附带的另一个工具,允许你查询 socket 的有关统计信息。可以完成 netstat 同样的任务,但是,ss 稍微快一点而且命令更简短。 -- Mathieu Trudel-lapierre
编译自: https://insights.ubuntu.com/2017/07/25/ss-another-way-to-get-socket-statistics/
作者: Mathieu Trudel-lapierre
译者: Vic020
$ ss -t
State Recv-Q Send-Q Local Address:Port Peer Address:Port
ESTAB 0 0 127.0.0.1:postgresql 127.0.0.1:48154
ESTAB 0 0 192.168.0.136:35296 192.168.0.120:8009
ESTAB 0 0 192.168.0.136:47574 173.194.74.189:https
[…]
$ ss state all sport = :ssh
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
tcp LISTEN 0 128 *:ssh *:*
tcp ESTAB 0 0 192.168.0.136:ssh 192.168.0.102:46540
tcp LISTEN 0 128 :::ssh :::*
$ ss state connected sport = :ssh
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
tcp ESTAB 0 0 192.168.0.136:ssh 192.168.0.102:46540
$ ss state all dst 74.125.0.0/16
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
tcp ESTAB 0 0 192.168.0.136:33616 74.125.142.189:https
tcp ESTAB 0 0 192.168.0.136:42034 74.125.70.189:https
tcp ESTAB 0 0 192.168.0.136:57408 74.125.202.189:https
欢迎光临 51学通信论坛2017新版 (http://bbs.51xuetongxin.com/) | Powered by Discuz! X3 |