Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a command I can use from the Terminal on OS X to get the usage percentage per CPU/core in numerical format on my dual-core iMac?

I'm going to need to grab this every 5/10 seconds so I'm looking for something "low-cost" - that isn't going to hit the CPU too hard. Maybe something like top, but which shows both CPU/cores, that I can parse and then display in GeekTool;

Core 1: 11%
Core 2: 7%
share|improve this question

Top shows individual cores, you only have to press '1'. I think there's also an option to change the refresh rate.

share|improve this answer
1  
OS X's top doesn't have this nice Linux-y feature. – guns Sep 9 '09 at 22:35
    
didn't know that, I expected it to be a standard feature – bandi Sep 10 '09 at 10:42

There is a wonderful extension to top, called HTop, which shows real-time graphs per CPU in the top-left of the display, as well as many other controls and great customisability:

htop

There is a tutorial on how to get a HTop port built for OS X:

http://www.geektechnica.com/2009/07/how-to-install-htop-on-osx/

http://github.com/AndyA/htop-osx/tree/master

UPDATE:

htop from macports installs and works perfectly.

share|improve this answer
2  
The title bar, it burns! – jtbandes Aug 23 '09 at 3:38
    
htop needs to be updated for Snow Leopard: trac.macports.org/ticket/21036 – hanleyp Sep 5 '09 at 2:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .