linux
1、 netstat -tlnp 查看端口情况
2、netstat -tlnp | grep 30227 筛选 查看30227端口
3、lsof -i :80 查看80端口
windows
1、netstat -aon|findstr "30316"
C:\Users\xxx>netstat -aon|findstr "30316"
TCP 0.0.0.0:30316 0.0.0.0:0 LISTENING 6340
TCP [::]:30316 [::]:0 LISTENING 63402、tskill 6340 杀死进程
或者 taskkill /pid 6340 -t -f
本文介绍了在Linux和Windows系统中如何使用命令行工具检查指定端口的状态,并提供了关闭特定进程的方法。对于Linux, 使用netstat-tlnp及lsof-i等命令;而在Windows上,则可以通过netstat-aon结合findstr进行端口查询,再利用tskill或taskkill来结束占用端口的进程。
1万+

被折叠的 条评论
为什么被折叠?



