troubleshooting Question

Grep for a specific string

Avatar of luser9999
luser9999 asked on
12 Comments1 Solution568 ViewsLast Modified:

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/ -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 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,



Join our community to see this answer!
Unlock 1 Answer and 12 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros