Last Updated: February 25, 2016
·
14.14K
· fideloper

Get count of running apache processes

Original post on my tumblr.

$ pgrep apache2 | wc -l

Explanation:

pgrep will search processes just like "grep". Above, I am searching for processes which match "apache2". You may want to search for "http" or "httpd" if apache2 isn't what your Apache processes is called.

wc -l WC will print newline, word or byte counts for a file or piped in content. The -l flag specifically prints the newline count.

Combined, this command will list the number of apache2 processes currently running.