Determine the process pid listening on a certain port

前端 未结 8 1726
孤城傲影
孤城傲影 2021-01-29 23:30

As the title says, I\'m running multiple game servers, and every of them has the same name but different PID and the port number. I would

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-29 23:43

    Syntax:

    kill -9 $(lsof -t -i:portnumber)

    Example: To kill the process running at port 4200, run following command

    kill -9 $(lsof -t -i:4200)
    

    Tested in Ubuntu.

提交回复
热议问题