Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm exploring building an internal site that displays what computers in the lab are currently being used. My initial idea involved a webapp that took in info from each computer every 5-10 minutes and then displayed that information. What I'm wondering is if there's a good way of getting the status of a machine (if it's logged on, and what program is currently on top)? Is this something that can be done at the shell level? (for instance, some sort of chron job, or script that runs while somebody is logged on).

share|improve this question

Things might have changed since I last checked this (10.6.5ish), but a user running Dock was usually a good indicator he/she is logged in:

ps aux | grep Dock

And you can get a sort of list of running apps by running:

ps aux | grep /Applications/

This is a little bit weak because some apps run outside of the /Applications folder..

share|improve this answer

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.