#!/bin/bash
sum=0
for n in `ps -aux | grep -v 'TIME COMMAND'|awk '{print $6}'`
do
sum=$[$sum+$n]
done
echo $sum
#!/bin/bash
sum=0
for n in `ps -aux | grep -v 'TIME COMMAND'|awk '{print $6}'`
do
sum=$[$sum+$n]
done
echo $sum
本文标题:【shell脚本003】统计所有进程内存占用之和
本文链接:https://www.haomeiwen.com/subject/nazmectx.html
网友评论