Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 was curious if anyone new a command like tail or top to constantly monitor a service as it runs. I'm trying to watch sendmail currently to see who is connecting to it, but would like to have it a little more dynamic than just repeatedly typing ps aux | grep send

is there a good way to constantly keep this running? Thanks guys n' gals

share|improve this question
tail -f /var/log/mail.log | fgrep send – mailq Dec 5 '11 at 23:22
Awesome I didn't think about just tailing the file. Thanks mailq – ehime Dec 5 '11 at 23:24
up vote 1 down vote accepted

You can use the watch command along with ps -aux to refresh. watch -n 5 "ps -axf |grep send" will run the ps command every 5 seconds (note the quotes).

share|improve this answer
Great this is the answer, just waiting for the four minutes to chalk down to accept. Thanks slillibri (sp?) – ehime Dec 5 '11 at 23:25
I have an alternative use for watch, which is the nastiest hackiest continuous integration ever. watch git pull – Tom O'Connor Dec 6 '11 at 0:17

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.