How to kill a process on a port on ubuntu

前端 未结 27 2238
天涯浪人
天涯浪人 2020-12-02 03:05

I am trying to kill a process in the command line for a specific port in ubuntu.

If I run this command I get the port:

sudo lsof -t -i:9001
         


        
27条回答
  •  攒了一身酷
    2020-12-02 04:02

    Displays active TCP connections, ports on which the computer is listening.

    netstat -tupln
    

    It will list you all the connection along pid. Find and copy the pid and run the following command. Make sure you replace the with actual id in the following command.

    kill -9 
    

    -9 use to forcefully kill the connection.

提交回复
热议问题