Find Out Which Process Is Listening Upon a Port

How do I find out running processes were associated with each open port?

#sudo netstat -lpn |grep :8080

You will get an output similar to this one

tcp6       0      0 :::8080                 :::*                    LISTEN      6782/java

The process i, which is 6782, now this is the process that is using port 8080.

Kill the process, type: kill 6782

# kill -9 6782

and now port 8080 is free.