zoukankan      html  css  js  c++  java
  • 如何通过ps -ef|grep tomcat只获得你需要的查询进程,排除掉grep本身的进程信息

    执行命令:ps -ef|grep tomcat|grep /opt/upay3/application/dispatcherTomcat/bin
    输出的进程信息会显示2个:包括grep本身的进程+你查询的进程
    dispatcherTomcatInfo: ['upay3     4627     1 11 14:27 pts/0    00:00:50 /usr/jdk1.7.0_67/bin/java -Djava.util.logging.config.file=/opt/upay3/application/dispatcherTomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/upay3/application/dispatcherTomcat/endorsed -classpath /opt/upay3/application/dispatcherTomcat/bin/bootstrap.jar:/opt/upay3/application/dispatcherTomcat/bin/tomcat-juli.jar -Dcatalina.base=/opt/upay3/application/dispatcherTomcat -Dcatalina.home=/opt/upay3/application/dispatcherTomcat -Djava.io.tmpdir=/opt/upay3/application/dispatcherTomcat/temp org.apache.catalina.startup.Bootstrap start ', 'upay3     4753  4752  0 14:34 ?        00:00:00 bash -c ps -ef|grep tomcat|grep /opt/upay3/application/dispatcherTomcat/bin ']
    执行命令:ps -ef|grep tomcat|grep /opt/upay3/application/dispatcherTomcat/bin|grep -v grep
    输出的只有你查询的进程:
    dispatcherTomcatInfo: ['upay3     4627     1  4 14:27 pts/0    00:01:02 /usr/jdk1.7.0_67/bin/java -Djava.util.logging.config.file=/opt/upay3/application/dispatcherTomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/upay3/application/dispatcherTomcat/endorsed -classpath /opt/upay3/application/dispatcherTomcat/bin/bootstrap.jar:/opt/upay3/application/dispatcherTomcat/bin/tomcat-juli.jar -Dcatalina.base=/opt/upay3/application/dispatcherTomcat -Dcatalina.home=/opt/upay3/application/dispatcherTomcat -Djava.io.tmpdir=/opt/upay3/application/dispatcherTomcat/temp org.apache.catalina.startup.Bootstrap start ']

  • 相关阅读:
    Java设计模式-----装饰模式
    Java并发包中Lock的实现原理
    ThreadLocal,静态变量,实例变量,局部变量的线程安全
    ThreadLocal类详解
    SQL之LEFT JOIN,EIGHT JOIN,INSERT JOIN的区别
    Wireshark 、HTTPWatch、Fiddler的介绍
    TCP/IP、HTTP、Socket的区别
    我希望你并不幸福
    Autoregressive Convolutional Neural Networks for Asynchronous Time Series
    DRL Lecture1:Policy Gradient
  • 原文地址:https://www.cnblogs.com/apple2016/p/5711191.html
Copyright © 2011-2022 走看看