Windows和Linux查看端口占用

Windows方法

TCP

netstat -aon|findstr "TCP"|findstr "LISTENING"|findstr ":135[^0123456789]"

UDP

netstat -aon|findstr "UDP"|findstr ":5353[^0123456789]"

最后面的数字为PID

接下来只要在tasklist里找PID一样的程序就行了

tasklist|findstr

Linux方法

lsof -i -P -n|grep -v ESTABLISHED

猜你喜欢

转载自www.cnblogs.com/DragonStart/p/9810029.html