Created
June 11, 2014 14:07
-
-
Save egulhan/e39a3cee1ec0420f1c77 to your computer and use it in GitHub Desktop.
How to get CPU usage in percent on Linux
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
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
space between % and id cant or not exists: