Linux find which process is using which port

Below commands can be used to find what are the ports currently used and associated process.

$ netstat -ant

Which tells the list of ports currently used by the system

$ lsof -i:8080

Above command lists the process name with details which uses the port 8080. Also shows process id PID and in which user the process is running.

 $ fuser 80/tcp

Also can find the process/service listening on a particular port by running the command below (specify the port).

Tags: Linux, Networking Commands