how to kill process in Linux which uses given port e.g. 5000
- User
how to kill process in Linux which uses given port e.g. 5000
Assistant
To kill a process using a specific port in Linux, you can use this command:
sudo kill $(sudo lsof -t -i:5000)Or if you want to see the process details first before killing it:
sudo lsof -i:5000Then kill it with:
sudo kill <PID>Or for a more forceful termination:
sudo kill -9 <PID>Would you like me to explain how these commands work?
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.