Home > Linux > How to kill Linux process by port

How to kill Linux process by port

Below is the command which will kill all the processes which are using a particular port. For example, say we want to kill the process which is using port 9091 in our Linux server.

kill -9 $(lsof -i:9091 -t) 2> /dev/null