For Linux queries, it is better to stop the tomcat process than to keep a good memory, and record the knowledge of Linux. The project needs to restart tomcat regularly, so write a script. There is a sentence to query the current tomcat running process. Ps-ef | greptomcat-dir | grep-vg Linux query. it is better to stop the tomcat process and keep a record of your knowledge in Linux. The project needs to restart tomcat regularly, so write a script. There is a sentence to query the current tomcat running process. Ps-ef | grep tomcat-dir | grep-v grep | awk '{print $2}' # tomcat-dir: tomcat installation path. # Grep-v: Invert selection (matching rows are not displayed) grep-v grep does not display rows containing (grep) fields # awk: process the query results $0: complete path $1: current login username $2: tomcat process pid currently has 4 tomcat processes. Shutdown. sh many times does not completely stop the tomcat process, so you need this pid to end the process. Kill-9 tomcat-pid
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.