top获取根据进程ID获取CPU使用率

top -n 2 | grep pid |tail -n 1 | awk '{print $9}'

-n 设置退出前屏幕刷新的次数  
posted @ 2022-04-21 20:41  lucky_tomato  阅读(109)  评论(0编辑  收藏  举报