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
namely: NETSTAT–APN | grep 8080
To view a process:
1. The PS command is used to view the currently running process.
grep is a search
Example: Ps-ef | grep java
Represents the process information for viewing all processes where CMD is Java
2, Ps-aux | grep java
-aux Show All States
Ps
3. Kill command to terminate the process
Example: kill-9 [PID]
-9 means the forced process stops immediately
Usually use PS to view the process PID, terminate the process with the KILL command
Linux viewing ports, process conditions, and kill processes