Ubuntu - Kill the process executing on PORT |
We face this when the memory is frozen in the system or the code is not good to handle these kinds of situations.
Then there is ultimate solution is to kill the process and get rid of it.
We can do so if required in Ubuntu with the following command:
sudo kill $(sudo lsof -t -i:<PORT NO>)
Example
sudo kill $(sudo lsof -t -i:1338)
So after this command, whatever service which was running on the port 1338 will be killed immediately and if there is any dependent process on the above port will also be killed.
Keep Learning :)