windows和Linux下查看端口和占用进程

windows系统下

c:\>netstat -ano |findstr "80"查看是否有进程占用80端口

   TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 2736

占用80端口的进程,进程号为2736


c:\>tasklist |findstr "2736"

    peer.exe 2016 Console 0 16,064 K

查看占用该进程的程序为peer.exe


c:\>taskkill /pid 2736 /F

终止pid为2736的进程


Linux系统下

netstat -anl |grep "80"

lsof -i:80

kill pid

你可能感兴趣的:(windows,linux,查看)