windows/mac查看端口被哪个进程占用
windows:
netstat -aon|findstr “PORT” 例 netstat -aon|findstr “9001”
tasklist|findstr “PID” 查看占用PID的进程是谁 例 netstat -aon|findstr “4”
3.tskill PID 例 tskill 4
MAC/LINUX
1.netstat -tunpl |grep 端口号 例 netstat -tunpl |grep 8080
2.ll /proc/PID/cwd 查看占用PID的进程是谁 例 ll /proc/30922/cwd
3.KILL PID 关闭进程 kill 30922
还没有评论,来说两句吧...