How to check if there is a process listening on a port in linux

It can often happen that some process is already running on a port, and maybe you want to know what that process is so that you may kill it if it no longer required. Assuming that PORTNUM is the port that you are interested in, run the following command

netstat -plunt | grep :PORTNUM

NOTE: plunt is not a word, I just jumbled the single character options to make it easy to remember 😛


Ryan Sukale

Ryan is just a regular guy next door trying to manage his life and finances.

You may also like...