Liunx kills the process occupied by the port

When writing a python project, the port 8000 I want to use is occupied by other programs, mainly because the restart of the Django project is invalid because the liunx system is not completely closed. The solution is as follows:

1. Find an occupied program

    netstat -apn | grep 8000

The last item shows the pid and the corresponding name

2. Kill the corresponding process, kill the process completely

kill -9  pid

3. Restart the service and successfully solve the problem

Guess you like

Origin blog.csdn.net/qq_49491645/article/details/128868619