一句话进入日志文件目录: p="cd $(ps -ef|grep tomcat|egrep -o "/(\d|\w|/|-|\.)*tomcat.*/conf"|head -n 1)/../logs/" && $p