리눅스 CPU 유휴율

1 방법[ | ]

1.1 명령어[ | ]

top -n 1 | grep -i cpu\(s\)| awk '{print $5}'

1.2 실행 예시[ | ]

[root@localhost ~]# top -n 1 | grep -i cpu\(s\)| awk '{print $5}'
98.7%id,

→ CPU 유휴율은 98.7%이다.

2 변수에 담기[ | ]

2.1 명령어[ | ]

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

2.2 실행 예시[ | ]

[root@localhost ~]# PIDLE=`top -n 1 | grep -i cpu\(s\)| awk '{print $5}' | tr -d "%id,"`
[root@localhost ~]# echo $PIDLE
98.7

3 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}