查看谁占用了你的本地端口
通用的是 netstat -anp [|grep xxx]
我觉得这三个选项是最常用的了
a all
n numeric
p program (display PID/Program name for sockets
u udp服务
t tcp服务
windows
netstat -aon|findstr 端口号 #windows下
会显示该端口的占用情况(最后一栏是占用该端口的进程的PID)
然后打开任务管理器的详细信息一栏(建议按一下PID这样可以使条目根据PID号进行排序后显示)
这样就可以愉快地找(杀)进程啦~
linux(两个方法)
- lsof -i:端口号 # 但是要开启管理员权限
list open files
- netstat -tunpl | grep 端口号