RE: shell script to count httpd processes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



What about ps -afe | grep /usr/sbin/httpd | grep -v grep| wc -l

K.i.s.s.

-- 
Patrick Campbell
OurVacationStore.com
Website Administrator
Tel. 602.896.4729

-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx [mailto:redhat-list-bounces@xxxxxxxxxx]
On Behalf Of Steve Kozakoff
Sent: Monday, March 14, 2005 3:22 PM
To: redhat-list@xxxxxxxxxx
Subject: RE: shell script to count httpd processes

I would recommend looking for the full path, in case (like me) you have
other things with the string "httpd" in the name.

for i in `ps -afe | grep /usr/sbin/httpd | grep -v grep | awk '{print
$2}'`
do
        COUNT=$((COUNT+1))
done
echo $COUNT

(Another) Steve

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux