redhat

Get Process Count on Linux

The first part is to identify the PPID. I used this command to get my PPID for the mysql user:

# ps -A -mPl | grep mysql

 

I then used this command to get the total count for all child processes for the given PPID for the mysql user:

# ps -elm|grep 902|grep -v grep |wc -l

Output

377

 

If you want to get a count of ALL processes, use the following command:

#  ps -elm|wc -l

Output

1142

 

Kevin is putting a script together that will collect these counts periodically. One of us will post it to the article when tested and complete.

Posted in Linux SysAdmin and tagged , , , , , , .

Leave a Reply

Your email address will not be published. Required fields are marked *


*