In Linux, we often use "ps-ef|grep tomcat" to view the process as the result of using the command on the server I am working on:
As you can see, there is a process for that command in addition to the 3 purple Tomcat.
If you want to exclude the current process of the red box, you can add a parameter filter after the original command, as follows:
Ps-ef|grep tomcat|grep-v grep
Only so, because I personally have a need: Write a sh script in the Tomcat/bin directory, kill the current Tomcat process.
Write the kill.sh script and place the script in the Tomcat/bin directory with the following contents:
#!/bin/shtom_home=$ (CD ' DirName $ '; CD.; PWD) kill-9 ' ps-ef|grep $TOM _home|grep-v Grep|awk ' {print $} '
Use the command chmod +x kill.sh to grant executable permissions to the script.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Linux PS-EF exclude current process (kill current Tomcat process)