开发者

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开发者_StackOverflow:)


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


The utility watch is meant for this purpose also:

watch ps 4815
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜