-
-
Save kezenwa/3e79cc46cb8021a264351a45035ee691 to your computer and use it in GitHub Desktop.
How to get CPU usage in percent on Linux
This file contains 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
top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1"%"}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment