Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In Linux, I could discover the number of running and blocked processes running

grep "procs_running" /proc/stat


grep "procs_blocked" /proc/stat

Is there a way to do it in Mac OS X? Preferably, a way which I could use in a shell script?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Have you thought about parsing something like:

ps -AO wqb,wqr,flags,state

this via script for your proc info? Between the workqueue threadcount, proc.h flags, and state that should be enough to grep up any snapshot statistics... Or perhaps not. Let me know!

share|improve this answer
Actually, I thought about counting the number of lines of ps aux output but I was not sure if ps aux would list all processes. Also, I do not know if it is possible to know whether a processes is blocked or running using ps... – brandizzi Dec 13 '10 at 18:35
Well, the only solution I've found was something like this... It is better explained in… Thank you anyway! – brandizzi Dec 14 '10 at 14:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.