View Port:
PS-Aux | grep Tomcat
Tomcat process with no port 8080 is found.
Run netstat-APN
View all processes and port usage. The following process list is found. The last column isPid/program name
Port 8080 is occupied by Java processes with a PID of 9658.
Run the following command: PS-Aux | grep Java, or run the command: PS-Aux | grep PID.
You can clearly know which port 8080 isProgramOccupied! Then determine whether to use the kill command to kill it!
Method 2: directly use netstat-anp | grep portno
That is, netstat-APN | grep 8080
View process:
1. The ps command is used to view the currently running process.
Grep is search
Example: PS-Ef | grep Java
Displays information about Java cmd processes in all processes.
2. PS-Aux | grep Java
-Aux: Show All statuses
PS
3. The kill command is used to terminate the process.
Example: Kill-9 [pid]
-9 indicates that the process is forced to stop immediately.
You can use PS to view the process PID and kill to terminate the process.