Open Laboratory for Technocrats

Grab the developer role, learn concepts & prepare with senior software engineers to get solutions for problems in a software job. Coding and Programming Solutions crafted for you.

Ubuntu - Kill the process executing on PORT

Ubuntu - Kill the process executing on PORT
Ubuntu - Kill the process executing on PORT
You might have stuck in some process which is long enough to end but they are still alive on the processing list.

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 :)



Top #3 Articles