1 방법1: mpstat[ | ]
명령어
Bash
Copy
mpstat | tail -1 | awk '{print 100-$NF}'
실행예시
Console
Copy
# mpstat
Linux 3.10.0-862.14.4.el7.x86_64 (centos7) 11/14/2019 _x86_64_ (1 CPU)
07:36:08 AM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
07:36:08 AM all 0.44 0.00 0.39 0.21 0.00 0.03 0.00 0.00 0.00 98.93
Console
Copy
# mpstat | tail -1 | awk '{print 100-$NF}'
1.07
- → CPU 사용률은 1.07%이다.[1]
2 방법2: top ★[ | ]
명령어
Bash
Copy
top -b -n1 | grep -Po '[0-9.]+ id' | awk '{print 100-$1}'
실행예시
Console
Copy
root@centos7:~# top -b -n1 | grep -Po '[0-9.]+ id'
93.8 id
root@centos7:~# top -b -n1 | grep -Po '[0-9.]+ id' | awk '{print 100-$1}'
6.2
- → CPU 사용률은 6.2 %이다.[2]
3 같이 보기[ | ]
- 리눅스 프로세스 CPU 사용률
- 리눅스 코어별 CPU 사용률 확인
- 리눅스 CPU 유휴율
- 리눅스 메모리 사용률
- 리눅스 top
- 리눅스 sar (시간대별 CPU 사용률 조회가능)
- CPU 부하량(load average)
4 참고[ | ]
편집자 Jmnote bot 114.203.110.69 Jmnote 211.54.75.22
로그인하시면 댓글을 쓸 수 있습니다.