keepcalculator

06 Numbers and Powers

Htop for Mac: Install and Use It

Card No. 06·84524 · Updated · Standard formula, shown below

Htop is a terminal-based process viewer that shows running processes, CPU and memory usage, and lets you manage them interactively. On a Mac, you can install it with Homebrew (“brew install htop”) and launch it by typing “htop” in Terminal. This article explains what htop does, how to set it up on macOS, and how to use it effectively.

What Is Htop?

Htop is an interactive process viewer for Unix-like systems, first released in 2004 by Hisham Muhammad. Unlike the default “top” command that ships with macOS, htop provides a color-coded, scrollable interface with a tree view, mouse support, and the ability to send signals (like kill) to processes without typing their PID. It reads process information from the /proc filesystem on Linux, but on macOS it uses the sysctl and libproc interfaces, so it works natively after compilation.

Many Mac users prefer htop because it gives a more intuitive overview of system load. The top of the screen shows a CPU usage bar for each core, a memory bar, and a swap bar. Below that is a list of processes with columns for PID, user, CPU%, memory%, and command. You can sort by any column, search with F3, filter with F4, and kill a process with F9.

How to Install Htop on macOS

The easiest way to install htop on a Mac is through Homebrew, the most popular package manager for macOS. If you do not have Homebrew, install it first by running the command from the official Homebrew website (paste the one-liner into Terminal). Once Homebrew is ready, open Terminal and run:

brew install htop

This command downloads the source code and compiles it for your Mac. The process usually takes less than a minute. After installation, type “htop” and press Enter to launch it. If you prefer not to use Homebrew, you can also build htop from source using the instructions on its official GitHub repository, but that requires installing a C compiler and the ncurses library, which is more work for most users.

How to Use Htop

Once htop is running, you will see a full-screen interface. Here are the basic controls:

  • F1 – Help screen
  • F2 – Setup (change colors, columns, display options)
  • F3 – Search for a process by name
  • F4 – Filter processes by name
  • F5 – Tree view (shows parent-child relationships)
  • F6 – Sort by a chosen column
  • F7/F8 – Increase/decrease process priority (niceness)
  • F9 – Send a signal (like SIGKILL) to the selected process
  • F10 – Quit htop

You can also use mouse clicks to select processes and press “u” to filter by user, “t” to toggle tree view, and “P” to sort by CPU usage. The header bars show CPU usage per core (green for user, blue for low-priority, red for system), memory (green for used, blue for buffers, yellow for cache), and swap (red).

Htop vs. macOS Activity Monitor

macOS includes a graphical tool called Activity Monitor (in Applications/Utilities) that shows similar information. Activity Monitor has a nicer GUI, graphs, and energy impact data, but htop is faster to launch from the terminal and works over SSH sessions. If you are managing a remote Mac or a Linux server, htop is invaluable because it works in a text-only environment. For everyday local use, Activity Monitor may be more approachable for beginners. However, htop uses fewer system resources than a GUI app, which can matter on older Macs.

Common Problems and Fixes

Some Mac users report that htop shows incorrect CPU usage or missing processes. This is often because htop needs elevated privileges to see all processes. Run htop with sudo htop to see every process, but be careful – you can kill system processes with root access. Another issue is that htop might not display correctly in a small terminal window; resize the window or press F2 and reduce the number of columns. If htop crashes on launch, try reinstalling with brew reinstall htop or check that your macOS version is supported (htop 3.x works on macOS 10.12 and later).

Alternatives to Htop

If htop does not meet your needs, there are several alternatives:

  • btop – A modern, graphical terminal monitor with mouse support and themes
  • glances – A cross-platform system monitor with a web interface option
  • nmon – A lightweight monitor popular on Linux, also available for macOS
  • top – The built-in macOS process viewer (press “o” to sort by CPU)
  • Activity Monitor – The graphical GUI option

Each has its own strengths. btop is more visually appealing, while glances can export data to a remote server. For most users, htop remains the best balance of simplicity and power.

Is Htop Safe to Use?

Yes, htop is safe. It is open-source software with a long history and no known malware. The version from Homebrew is compiled from the official source, so you are not trusting a random binary. Running htop does not modify any system files; it only reads process information and, when you send signals, it asks for confirmation. The only risk is if you use sudo htop and accidentally kill a critical system process, which could freeze your Mac. Always double-check the PID before pressing F9.

Frequently Asked Questions

Does htop work on Apple Silicon (M1/M2) Macs?

Yes, htop works on Apple Silicon Macs. Homebrew installs an ARM64 version that runs natively. If you are using Rosetta Terminal, it will install the x86_64 version, which also works but may use more memory.

How do I quit htop?

Press F10 or the “q” key. If you are in a menu, press Esc first. You can also close the terminal window, but that might leave background processes running.

Why does htop show more CPU than Activity Monitor?

Htop shows CPU usage per core, so on a 4-core Mac, 100% means one core is fully used, not the whole CPU. Activity Monitor shows overall usage. Multiply the htop percentage by the number of cores to compare.

Can I see network and disk usage in htop?

By default, htop does not show network or disk I/O. You can enable them in Setup (F2) under “Columns”, but you need to install additional libraries like libstatgrab on Linux. On macOS, these features are limited; use “glances” for full I/O monitoring.

How do I update htop?

Run brew update then brew upgrade htop. This will fetch the latest version if available. Check your current version with htop --version.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →