How to find and kill a process using a specific port
Answered
14
I need to free up port 8000 but something is already using it. How can I find what process is using it and kill it?
Y
Asked by
youssef_net
Platinum
•
311 rep
1 Answer
16
Find process using port
# Using lsof
sudo lsof -i :8000
# Using netstat
sudo netstat -tlnp | grep :8000
# Using ss
sudo ss -tlnp | grep :8000
Kill the process
# Kill by PID
kill -9 PID_NUMBER
# Kill all processes on port (one-liner)
sudo fuser -k 8000/tcp
P
Platinum
•
447 rep
Your Answer
You need to be logged in to answer questions.
Log In to Answer