ProcessName 为唯一进程名
ps -ef|grep ProcessName |grep -v "grep"|wc -l 或 pgrep -l ProcessName |wc -l
如:
root 29151 28812 0 10:04 pts/3 00:00:00 /usr/bin/php ./call.ami.php
root 29155 28685 0 10:04 pts/1 00:00:00 grep call.ami.php
[root@text index]# ps -ef|grep call.ami.php |grep -v "grep"|wc -l
1