htop isn't returning CPU or memory usage!?

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
EOS

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


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/0.8.2.2/bin/htop

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

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


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'