Created
December 10, 2019 00:05
-
-
Save lazidoca/196341fced610a7f8ab4a989c8f8ce3c to your computer and use it in GitHub Desktop.
View CPU percentage usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk '{u=$2+$4; t=$2+$4+$5; if (NR==1){u1=u; t1=t;} else print ($2+$4-u1) * 100 / (t-t1) "%"; }' \ | |
<(grep 'cpu ' /proc/stat) <(sleep 1;grep 'cpu ' /proc/stat) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment