1.查看tomcat7_8080的gc状态
$ 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'