Hi,
I have many tomcat instances are running on Linux server and I would like to grep them based on a string called "catalina.base" here is one example
root 27180 1 0 Feb25 ? 00:02:10 /opt/java/jdk1.5.0_16//bin/java -Djava.util.logging.config.file=/opt/net/crowd-2.0.3/apache-tomcat/conf/logging.properties -Xms128m -Xmx256m -XX:MaxPermSize=256m -Dfile.encoding=UTF-8 -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/net/crowd-2.0.3/apache-tomcat/endorsed -classpath :/opt/net/crowd-2.0.3/apache-tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/net/crowd-2.0.3/apache-tomcat -Dcatalina.home=/opt/net/crowd-2.0.3/apache-tomcat -Djava.io.tmpdir=/opt/net/crowd-2.0.3/apache-tomcat/temp org.apache.catalina.startup.Bootstrap start
So when i " ps -ef | grep java" --> will return all the instances of java and out of which I need only the string value "-Dcatalina.base="
to make it clear my search out put should be,
-Dcatalina.base=/opt/net/crowd-2.0.3/apache-tomcat
-Dcatalina.base=/opt/test/tomcat-2.0.3/apache-tomcat
-Dcatalina.base=/opt/test123/staging/apache-tomcat
-Dcatalina.base=/home/catalina/catalina-2.0/apache-tomcat
thanks
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.