17

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!

bandhunt
  • 273
  • 2
  • 5

2 Answers2

27
watch 'ps aux | grep httpd | wc'
Steven Monday
  • 13,599
  • 4
  • 36
  • 45
2
while true
do
  ps aux | grep httpd | wc
  sleep 10
done
jlliagre
  • 8,861
  • 18
  • 36