查看進程
ProcessName 是否存在 存在則返回該進程的個數,不存在則返回0
ProcessName 為唯一進程名
ps -ef|grep
ProcessName |grep -v "grep"|wc -l 或 pgrep -l
ProcessName |wc -l
如:
[root@text index]# ps -ef | grep call.ami.php
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
1pgrep -l call.ami.php |wc -l 的執行結果與上面相同