본문 바로가기

linux

리눅스 리소스 바로확인 cpu mem

CPU

top -n 1 | grep -i cpu\(s\)| awk '{print $5}' | tr -d "%id," | awk '{print 100-$1}'

 

MEM

free | awk '/Mem/{printf("used: %.2f%"), $3/$2*100} /buffers\/cache/{printf(", buffers: %.2f%"), $4/($3+$4)*100} /Swap/{printf(", swap: %.2f%"), $3/$2*100}'


출처

http://unix.stackexchange.com/questions/152299/how-to-get-memory-usedram-used-using-linux-command


http://zetawiki.com/wiki/%EB%A6%AC%EB%88%85%EC%8A%A4_CPU_%EC%82%AC%EC%9A%A9%EB%A5%A0