标签:内存 IV style des home TE awk print linu
while [ 1 ] do clear ps aux | grep xmirror | grep -v grep mem=0 for data in `ps aux | grep xxxx | grep -v grep | awk ‘{print $4}‘` do mem=`echo $mem + $data | bc` done echo `date +%F" "%H:%M:%S` echo mem:{$mem} # if [ $mem -gt 2 ] if (echo ${mem} 2 | awk ‘!($1>$2){exit 1}‘) then # echo `date +%F" "%H:%M:%S`":"$mem echo `date +%F" "%H:%M:%S`" mem: "$mem echo `date +%F" "%H:%M:%S`" mem: "$mem >> /home/jll/Desktop/jll.log sleep 2 fi sleep 2 done ~
linux下打印出所选应用对应的内存情况和总和(shell)
标签:内存 IV style des home TE awk print linu
原文地址:https://www.cnblogs.com/jxba/p/9221268.html