#/bin/bash!
sum=0
for mem in `ps aux |awk '{print $6}'|grep -v 'RSS'`
do
sum=$[$sum+$mem]
done
echo "The total memory is $sum ""k"
本文共 176 字,大约阅读时间需要 1 分钟。
#/bin/bash!
sum=0
for mem in `ps aux |awk '{print $6}'|grep -v 'RSS'`
do
sum=$[$sum+$mem]
done
echo "The total memory is $sum ""k"
转载于:https://blog.51cto.com/2422606568/1607054