misc sh

 1 list=$(ps -eo rss,pid,rss,args | grep -v '\[' |  sort -k 1 -r -n | awk '{print $1}')
 2 total=0
 3 
 4 for e in $list;do 
 5     if [ "$e" != "RSS" ];then
 6         total=$((total+e))
 7     fi
 8 done 
 9 
10 echo $total

 

posted @ 2023-02-10 15:39  maojun1998  阅读(12)  评论(0编辑  收藏  举报