当前位置:   article > 正文

linux右上角显示cpu图标,Linux显示CPU 内存等信息

linux显示cpu在右上角

FREECPU=`iostat | head -4 | tail -1 | cut -d' ' -f31`

USEDCPU=`echo 100 - ${FREECPU}|bc`

echo "FREECPU: ${FREECPU} USEDCPU: ${USEDCPU} "

TOTALMEM=`free -m | grep "Mem:" | cut -d' ' -f12`

USEDMEM=`free -m | grep "Mem:" | cut -d' ' -f20`

FREEMEM=`free -m | grep "Mem:" | cut -d' ' -f29`

echo "TOTALMEM: ${TOTALMEM} USEDMEM: ${USEDMEM} FREEMEM: ${FREEMEM} "

TOTALSWAP=`free -m | grep "Swap:" | cut -d' ' -f10`

USEDSWAP=`free -m | grep "Swap:" | cut -d' ' -f20`

FREESWAP=`free -m | grep "Swap:" | cut -d' ' -f27`

echo "TOTALSWAP: ${TOTALSWAP} USEDSWAP: ${USEDSWAP} FREESWAP: ${FREESWAP}"

0b53d3ab02a19fb8435721b45648b271.png

FREECPU=`iostat | head -4 | tail -1 | cut -d' ' -f31`

USEDCPU=`echo 100 - ${FREECPU}|bc`

echo "FREECPU: ${FREECPU} USEDCPU: ${USEDCPU} "

TOTALMEM=`free -m | grep "Mem:" | awk '{print $2}'`

USEDMEM=`free -m | grep "Mem:" | awk '{print $3}'`

FREEMEM=`free -m | grep "Mem:" | awk '{print $4}'`

echo "TOTALMEM: ${TOTALMEM} USEDMEM: ${USEDMEM} FREEMEM: ${FREEMEM} "

TOTALSWAP=`free -m | grep "Swap:" | cut -d' ' -f10`

USEDSWAP=`free -m | grep "Swap:" | cut -d' ' -f20`

FREESWAP=`free -m | grep "Swap:" | cut -d' ' -f27`

echo "TOTALSWAP: ${TOTALSWAP} USEDSWAP: ${USEDSWAP} FREESWAP: ${FREESWAP}"

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/310499
推荐阅读
相关标签
  

闽ICP备14008679号