parsifal
parsifal

Reputation: 917

How to create a script for loop print ps information

Just as title mentioned, How can I oversee a process using ps with periodicity scanning just like command "top", thanks first:)

Upvotes: 1

Views: 4886

Answers (2)

drewrobb
drewrobb

Reputation: 1604

The utility watch is meant for this purpose also:

watch ps 4815

Upvotes: 4

SleighBoy
SleighBoy

Reputation: 501

If the process you want to see is PID 4815 and you want it to update every 2 seconds you could do an infinite while loop.

while true; do ps 4815; sleep 2; clear; done

Upvotes: 5

Related Questions