查看内存使用情况
1 > free -m | awk '{if(NR==2){print "Total Mem:" $2}else if(NR==3){print "Used Mem:" $3"\nFree Mem:" $4}}'
> top -n1 | awk '/Cpu/{print "Cpu used: "$2} /average/{print "Cpu average: "$11,$12,$13}'
本文共 274 字,大约阅读时间需要 1 分钟。
查看内存使用情况
1 > free -m | awk '{if(NR==2){print "Total Mem:" $2}else if(NR==3){print "Used Mem:" $3"\nFree Mem:" $4}}'
> top -n1 | awk '/Cpu/{print "Cpu used: "$2} /average/{print "Cpu average: "$11,$12,$13}'
转载于:https://www.cnblogs.com/cpython/p/6133022.html