如下:
查询监听LISTENING的端口1027
netstat -navo|find /i "listen"|find /i ":1027"
结果如下(最后一列是进程id):
C:\Users\Administrator>netstat -navo|find /i "listen"|find /i ":1027" TCP 0.0.0.0:1027 0.0.0.0:0 LISTENING 888 TCP [::]:1027 [::]:0 LISTENING 888
查询连接状态ESTABLISHED的进程
例如:查询连接到mysql数据库3306端口的进程
C:\Users\Administrator>netstat -navo|find /i "ESTABLISHED"|find /i ":3306" TCP 127.0.0.1:3306 127.0.0.1:7140 ESTABLISHED 1644 TCP 127.0.0.1:7140 127.0.0.1:3306 ESTABLISHED 8076
原文地址:https://www.cnblogs.com/passedbylove/p/11235752.html
时间: 2024-10-01 04:08:25