10
votes
3answers
3k views

How can I receive top-like CPU statistics from the shell?

I'm trying to get an accurate read of my used CPU (in percent) from top. This is the command I'm running for testing: top -n1 | awk '/Cpu\(s\):/ {print $2}' This returns: 10.7%us, Which is the ...