$ ss -t4 state established
Recv-Q Send-Q Local Address
ort Peer Address
ort
0 0 192.168.1.2:54436 165.193.246.23:https
$ ss -t4 state time-wait
Recv-Q Send-Q Local Address
ort Peer Address
ort
0 0 192.168.1.2:42261 199.59.150.39:https
$ ss -nt '( dst :443 or dst :80 )'
State Recv-Q Send-Q Local Address
ort Peer Address
ort
ESTAB 0 0 192.168.1.2:58844 199.59.148.82:443
# source address is 127.0.0.1 and source port is greater than 5000
$ ss -nt src 127.0.0.1 sport gt :5000
# local smtp (port 25) sockets
$ sudo ss -ntlp sport eq :smtp
# port numbers greater than 25
$ sudo ss -nt sport gt :1024
# sockets with remote ports less than 100
$ sudo ss -nt dport \< :100
# connections to remote port 80
$ sudo ss -nt state connected dport = :80
原文:
http://www.binarytides.com/linux-ss-command/
http://roclinux.cn/?p=2420