关闭端口占用程序

windows系统中,

1,【查看端口占用pid】

netstat -nao|findstr port_number

eg,

2.【使用上面得出的pid号,查看此指定端口的程序名,】

tasklist|findstr pid_number

eg,

3,【杀死指定端口进程】

taskkill /f /pid pid_number

【linux系统】

【一般情况下  netstat -nao|grep 389

ps -ef|grep svnserve

kill -9 pid】

我们在此来个小长命令搞定

 kill `netstat -ntlp|grep mysql|awk '{print $7}'|awk -F'/' '{print $1}'`

原文地址:https://www.cnblogs.com/ruiy/p/killcourse.html