查询指定tomcat应用的进程数
假设应用名称为pear,查询指定tomcat应用pear的进程数:
ps -ef |grep "/datong/tomcat-pear/" |grep -v tail | grep -v grep | wc -l
ps -ef |grep "/datong/tomcat-pear/" | grep -v 'tail\|grep' | wc -l
(grep -v tail | grep-v grep 等效于 grep -v 'tail\|grep')
备注:
grep -v tail:过滤含有tail的行
wc -l :计算行数