1.查看tomcat7_8080的gc状态标签:xargs,8080,tomcat7,命令,awk,JVM,print,工具,jps From: https://blog.51cto.com/u_15907520/5924544
$ jps -v | awk '/tomcat7_8080/{print $1}' | xargs jstat -gcutil
2.查看tomcat7_8082的堆状态
$ jps -v | awk '/tomcat7_8080/{print $1}' | xargs jmap -heap
3.查看tomcat7_8082的启动参数
jps -v | awk '/tomcat7_8080/{print $1}' | xargs jinfo -flags
4.获取运行时tomcat的目录位置
$ jps -v | awk '{print $((NF-2))}' | cut -d '=' -f 2 | grep -v 'Jps'