ps -ef | grep activemq
获取activemq使用的配置文件目录
[root@localhost tmp]# cat abc.txt
root 73920 1 0 Nov16 ? 01:44:25 /home/menhu/jdk/bin/java -Xms64M -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/home/menhu/apache-activemq//conf/login.config -Dcom.sun.management.jmxremote -Djava.awt.headless=true -Djava.io.tmpdir=/home/menhu/apache-activemq//tmp -Dactivemq.classpath=/home/menhu/apache-activemq//conf:/home/menhu/apache-activemq//../lib/: -Dactivemq.home=/home/menhu/apache-activemq/ -Dactivemq.base=/home/menhu/apache-activemq/ -Dactivemq.conf=/home/menhu/apache-activemq//conf -Dactivemq.data=/home/menhu/apache-activemq//data -jar /home/menhu/apache-activemq//bin/activemq.jar start
[root@localhost tmp]#
[root@localhost tmp]#
[root@localhost tmp]# cat abc.txt | awk '{for(i=1;i<=NF;i++){if ($i~/-Dactivemq.conf/) print $i}}'
-Dactivemq.conf=/home/menhu/apache-activemq//conf
[root@localhost tmp]#