Sunday 11 November 2012



To check  any type of process status and to count the no of process are currently running :-
#!/bin/bash
echo "To  check any type of processe status"
ps aux | grep $1 | grep -v "\(root\|grep\)" | wc -l

Run it by following command :-
sh cntproc.sh "process name"
examaple:- [root@localhost scriptexamples.sh]# sh cntproc.sh  sendmail
To count the currently how many apache processes are  running
1



No comments:

Post a Comment