10

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%
3

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

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

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

You can install it with any of the following:

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

https://web.archive.org/web/20100924083315/http://geektechnica.com/2009/07/how-to-install-htop-on-osx/

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

0

There's an updated htop project at Github by Hisham Muhammad , who has more info on his site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.