Linux 一行命令 查看 内存使用, cpu负载和使用率
查看内存使用情况
1 > free -m | awk '{if(NR==2){print "Total Mem:" $2}else if(NR==3){print "Used Mem:" $3"\nFree Mem:" $4}}'
查看cpu平均负载, cpu使用率
> top -n1 | awk '/Cpu/{print "Cpu used: "$2} /average/{print "Cpu average: "$11,$12,$13}'