Use netstat in Linux to determine port conflicts

linux-penguinI installed an application that required port 8080. I was unable to execute the application as port 8080 was already in use. Unable to determine which application, I changed the setting for the application I had just installed to port 8090. Success. However, I still wanted to know if anything was running on port 8080. Like Windows, Linux has a command line utility, netstat. Their capabilities and outputs are slightly different, however, in either case, you should be able to understand the results. There are many options and commands, but I found from within a forum , the command line that gave me the results I was looking for.

The command to use:

netstat -anp | grep 8000

To find out more about the switches that netstat and grep use, type –help at the end of the command line. (ie netstat –help or grep –help). The commands used in this example are the following:

-a, –all, –listening display all sockets (default: connected)
-n, –numeric don’t resolve names
-p, –programs display PID/Program name for sockets

grep to search for PATTERN in each FILE or standard input.