开发者

How to create a script for loop print ps information

开发者 https://www.devze.com 2023-01-27 18:42 出处:网络
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

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

精彩评论

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