Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a way to monitor the output of a linux command without having to type it over and over.

I want to do something like:

tail -f file.txt

But for a command like:

ps aux | grep httpd | wc

Thanks!

share|improve this question

2 Answers 2

up vote 8 down vote accepted
watch 'ps aux | grep httpd | wc'
share|improve this answer
    
-n 0.1 switch to watch can be really useful for fast-changing data –  Hubert Kario Oct 19 '10 at 7:27
while true
do
  ps aux | grep httpd | wc
  sleep 10
done
share|improve this answer

Your Answer

 
discard

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.