Wednesday, January 13, 2010

Count Total Process using pgrep..

Here is another useful command to count total process/thread is running.
When run ps aux... indeed can get all the running process..

# ps aux | grep httpd

But the list is too long..


Therefore.. have a try use pgrep..

# pgrep httpd

Can see all the list are the process id for the httpd process.

Then to count how much thread had been running by httpd..

# pgrep httpd | wc -l

Total process/thread is show up.

No comments: