View the port number occupancy and kill the port process under mac/windows

mac to view port occupancy:

lsof -i tcp:7000

insert image description here

Kill the process on the current port:

kill 44934  //这里的44934为PID

Windows checks the port occupancy:

netstat -ano

insert image description here
Find the PID of a port:

netstat -ano|findstr '7000'

insert image description here

Kill the current port process:

taskkill /T /F /PID 8784(端口对应的PID)

insert image description here

Guess you like

Origin blog.csdn.net/xieamy/article/details/108517715