8/5/2017, 3:51:03 PM
Sometimes, when we are developing a server #program , the #port may be occupied because we abnormally shut down our program. Therefore, we should find the process which is occupying the port and close it then the program work in the same port could work well.
Here are the instructions to find and close the #process in #MAC
# lsof -i :PORT_NUMBER
# for example the process in port 5566
lsof -i :5566
# output
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node 5955 ...
#-9 means force kill
kill -9 5955
After kill the process, you could execute the other program working in the same port number now.