refresh ps ax |grep using a script

hi all

I want to refresh

ps ax |grep something

using a script every n seconds.
Plz advise how to do that.

If you're on Linux, you probably have the watch utility:

watch -n5 'ps ax | grep something'

If you don't have it, try this:

while true
do
    clear
    ps ax | grep something
    sleep 5
done

Thanks pludi.
It works :slight_smile: