File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -51,16 +51,16 @@ ss [参数] [过滤]
51
51
52
52
### 实例
53
53
54
- ```
55
- ss -t -a 显示TCP连接
56
- ss -s 显示 Sockets 摘要
57
- ss -l 列出所有打开的网络连接端口
58
- ss -pl 查看进程使用的socket
59
- ss -lp | grep 3306 找出打开套接字/端口应用程序
54
+ ``` bash
55
+ ss -t -a # 显示TCP连接
56
+ ss -s # 显示 Sockets 摘要
57
+ ss -l # 列出所有打开的网络连接端口
58
+ ss -pl # 查看进程使用的socket
59
+ ss -lp | grep 3306 # 找出打开套接字/端口应用程序
60
60
ss -u -a 显示所有UDP Sockets
61
- ss -o state established '( dport = :smtp or sport = :smtp )' 显示所有状态为established的SMTP连接
62
- ss -o state established '( dport = :http or sport = :http )' 显示所有状态为Established的HTTP连接
63
- ss -o state fin-wait-1 '( sport = :http or sport = :https )' dst 193.233.7/24 列举出处于 FIN-WAIT-1状态的源端口为 80或者 443,目标网络为 193.233.7/24所有 tcp套接字
61
+ ss -o state established ' ( dport = :smtp or sport = :smtp )' # 显示所有状态为established的SMTP连接
62
+ ss -o state established ' ( dport = :http or sport = :http )' # 显示所有状态为Established的HTTP连接
63
+ ss -o state fin-wait-1 ' ( sport = :http or sport = :https )' dst 193.233.7/24 # 列举出处于 FIN-WAIT-1状态的源端口为 80或者 443,目标网络为 193.233.7/24所有 tcp套接字
64
64
65
65
# ss 和 netstat 效率对比
66
66
time netstat -at
@@ -84,7 +84,7 @@ ss src 192.168.119.103:25
84
84
85
85
** 将本地或者远程端口和一个数比较**
86
86
87
- ```
87
+ ``` bash
88
88
# ss dport OP PORT 远程端口和一个数比较;
89
89
# ss sport OP PORT 本地端口和一个数比较
90
90
# OP 可以代表以下任意一个:
@@ -108,7 +108,7 @@ ss -o state fin-wait-1 \( sport = :http or sport = :https \) dst 192.168.1/24
108
108
109
109
** 用TCP 状态过滤Sockets**
110
110
111
- ```
111
+ ``` bash
112
112
ss -4 state closing
113
113
# ss -4 state FILTER-NAME-HERE
114
114
# ss -6 state FILTER-NAME-HERE
You can’t perform that action at this time.
0 commit comments