"리눅스 CPU 사용률 확인"의 두 판 사이의 차이

(차이 없음)

2013년 2월 27일 (수) 10:37 판

1 방법1: mpstat

명령어
mpstat | tail -1 | awk '{print 100-$11}'
실행예시
[root@jmnote ~]# mpstat | tail -1 | awk '{print 100-$11}'
7.83
→ CPU 사용률은 7.83 %이다.[1]

2 방법2: top

명령어
top -n 1 | grep -i cpu\(s\)| awk '{print $5}' | tr -d "%id," | awk '{print 100-$1}'
실행 예시
[root@jmnote ~]# top -n 1 | grep -i cpu\(s\)| awk '{print $5}' | tr -d "%id," | awk '{print 100-$1}'
7.8
→ CPU 사용률은 7.8 %이다.[2]

3 같이 보기

4 주석

  1. mpstat은 소수점 둘째 자리까지 확인 가능.
  2. top은 소수점 첫째 자리까지 확인 가능.
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}