Look at the port:
Ps-aux | grep Tomcat
A tomcat process with no 8080 ports found.
Use command: NETSTAT–APN
View all process and port usage. Discover the following list of processes, where the last column is Pid/program name
8080 ports were found to be occupied by the Java process with PID 9658.
Further use of the command: Ps-aux | grep Java, or directly: Ps-aux | grep PID View
You can clearly know that the 8080 port is a program occupied! Then decide if you want to kill with the KILL command!
Method Two: Direct use of NETSTAT-ANP | grep portno i.e.: NETSTAT–APN | grep 8080
To view a process:
1. The PS command is used to view the currently running process. grep is a search for example: Ps-ef | grep Java means to view all processes where CMD is a Java process information 2, Ps-aux | grep java-aux Displays all status PS 3. The KILL command is used to terminate a process such as: kill-9 [PID]-9 means that forcing the process to stop immediately normally using PS to view the process PID, terminate the process with the KILL command
Linux viewing ports, process conditions, and kill processes