Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I think that top is great application to monitor a Linux system. I really like it, but top doesn't look so good on Mac. I know that Mac have a system monitor to do it, but I prefer using a terminal.

I have installed htop by running:

brew install htop.

Here is what it looks like:

    1 0          0   0     0     0     0 ?  0.0  0.0  0:00.00 (launchd)
   10 0          0   0     0     0     0 ?  0.0  0.0  0:00.00 (kextd)
   11 0          0   0     0     0     0 ?  0.0  0.0  0:00.00 (UserEventAgent)
   12 65         0   0     0     0     0 ?  0.0  0.0  0:00.00 (mDNSResponder)

The problem is that both CPU and MEM aren't returning the real values of either on my system.

Has anyone else experienced this? Or, could some one point me in the right direction?

share|improve this question

migrated from Sep 22 '11 at 18:36

This question came from our site for professional and enthusiast programmers.

up vote 83 down vote accepted

I have the same problem so I check the recipe.

$ brew edit htop

Then I check this part of the recipe:

    def caveats; <<-EOS.undent
        For htop to display correctly all running processes, it needs to run as root.
        If you don't want to `sudo htop` every time, change the owner and permissions:
        cd #{bin}
        chmod 6555 htop
        sudo chown root htop

So just type sudo htop and you will see CPU and MEM.

share|improve this answer
You can use brew info htop to see caveats content – A B Mar 29 '13 at 20:36
This is helpful for those who installed with macports as well; for me, I don't know why, but sudo htop didn't work. htop was installed in /bin, so I cd'd there and ran chmod 6555 htop && sudo chown root htop. Now htop works fine. – Brian McCutchon Sep 29 '14 at 20:22
@AB not anymore, they changed it. – Dalibor Filus Apr 6 '15 at 20:11
This solution allows any user to kill any other user's (or root's) processes. Is there a way to allow htop to read CPU and MEM without allowing it to modify the system? – Max Sep 2 '15 at 22:56

From my brew info:

You can either run the program via `sudo` or set the setuid bit:

  sudo chown root:wheel /usr/local/Cellar/htop-osx/

  sudo chmod u+s /usr/local/Cellar/htop-osx/

This worked to ensure that I don't need to run htop as sudo

share|improve this answer

Here is an alternative for those who don't want to muck with the permissions and still avoid typing sudo htop in preference to just htop:

  1. Install with brew: brew install htop
  2. Allow sudo htop to run without sudo password
    1. Run sudo visudo to open the sudoers file in an editor
    2. Add this to the config file: %admin ALL=(ALL) NOPASSWD: /usr/local/bin/htop
    3. Save the file and exit (:wq most likely)
  3. Add the following alias to your shell rc file (example is for ~/.bashrc or ~/.profile): alias htop='sudo htop'
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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