From this tutorial you would learn how to kill a process by lsof port info.
- Linux/Mac OS
First we start a process that listening to a port:
we found that the server port is 4000 Next we stop the process by run this command:
We found that the process is killed successfully.
The key command is kill -9 $(lsof -ti tcp:the_port)
You can find detail documents about the linux and lsof here: