| 1 |
# [](https://htop.dev) |
| 2 |
|
| 3 |
[](https://github.com/htop-dev/htop/actions) |
| 4 |
[](https://scan.coverity.com/projects/21665) |
| 5 |
[](https://groups.io/g/htop) |
| 6 |
[](https://web.libera.chat/#htop) |
| 7 |
[](https://github.com/htop-dev/htop/releases/latest) |
| 8 |
[](https://repology.org/project/htop/versions) |
| 9 |
[](COPYING?raw=true) |
| 10 |
|
| 11 |
 |
| 12 |
|
| 13 |
## Introduction |
| 14 |
|
| 15 |
`htop` is a cross-platform interactive process viewer. |
| 16 |
|
| 17 |
`htop` allows scrolling the list of processes vertically and horizontally to see their full command lines and related information like memory and CPU consumption. |
| 18 |
Also system wide information, like load average or swap usage, is shown. |
| 19 |
|
| 20 |
The information displayed is configurable through a graphical setup and can be sorted and filtered interactively. |
| 21 |
|
| 22 |
Tasks related to processes (e.g. killing and renicing) can be done without entering their PIDs. |
| 23 |
|
| 24 |
Running `htop` requires `ncurses` libraries, typically named libncurses(w). |
| 25 |
|
| 26 |
`htop` is written in C. |
| 27 |
|
| 28 |
For more information and details visit [htop.dev](https://htop.dev). |
| 29 |
|
| 30 |
## Usage |
| 31 |
See the manual page (`man htop`) or the help menu (`h` or `F1` inside `htop`) for a list of supported key commands. |
| 32 |
|
| 33 |
### Quick Start |
| 34 |
|
| 35 |
Some common actions to get you started with `htop` |
| 36 |
|
| 37 |
- Search processes: press `/` |
| 38 |
- Filter processes: press `\` |
| 39 |
- Toggle tree view: press `t` |
| 40 |
- Change process sort column: press `.` |
| 41 |
- Kill a process: select the process and press `k` |
| 42 |
|
| 43 |
## Build instructions |
| 44 |
|
| 45 |
### Prerequisite |
| 46 |
List of build-time dependencies: |
| 47 |
* standard GNU autotools-based C toolchain |
| 48 |
- C99 compliant compiler |
| 49 |
- `autoconf` |
| 50 |
- `automake` |
| 51 |
- `autotools` |
| 52 |
* `ncurses` |
| 53 |
|
| 54 |
**Note about `ncurses`:** |
| 55 |
> `htop` requires `ncurses` 6.0. Be aware the appropriate package is sometimes still called libncurses5 (on Debian/Ubuntu). Also `ncurses` usually comes in two flavours: |
| 56 |
>* With Unicode support. |
| 57 |
>* Without Unicode support. |
| 58 |
> |
| 59 |
> This is also something that is reflected in the package name on Debian/Ubuntu (via the additional 'w' - 'w'ide character support). |
| 60 |
|
| 61 |
List of additional build-time dependencies (based on feature flags): |
| 62 |
* `pkg-config` |
| 63 |
* `sensors` |
| 64 |
* `hwloc` |
| 65 |
* `libcap` (v2.21 or later) |
| 66 |
* `libnl-3` and `libnl-genl-3` |
| 67 |
|
| 68 |
`pkg-config` is optional but recommended. The configure script of `htop` might utilize `pkg-config` to obtain the compiler and linker flags required for a library. Some OS distributions provide `pkg-config` functionalities through an alternative implementation such as `pkgconf`. Look for both names in your package manager. |
| 69 |
|
| 70 |
Install these and other required packages for C development from your package manager. |
| 71 |
|
| 72 |
**Debian/Ubuntu** |
| 73 |
~~~ shell |
| 74 |
sudo apt install libncursesw5-dev autotools-dev autoconf automake build-essential |
| 75 |
~~~ |
| 76 |
|
| 77 |
**Fedora/RHEL** |
| 78 |
~~~ shell |
| 79 |
sudo dnf install ncurses-devel automake autoconf gcc |
| 80 |
~~~ |
| 81 |
|
| 82 |
**OpenSUSE/SLES** |
| 83 |
~~~ shell |
| 84 |
sudo zypper install ncurses-devel ncurses-devel-static automake autoconf gcc make glibc-devel glibc-devel-static |
| 85 |
~~~ |
| 86 |
|
| 87 |
**Archlinux/Manjaro** |
| 88 |
~~~ shell |
| 89 |
sudo pacman -S --needed base-devel ncurses |
| 90 |
~~~ |
| 91 |
|
| 92 |
**macOS** |
| 93 |
~~~ shell |
| 94 |
brew install ncurses automake autoconf gcc |
| 95 |
~~~ |
| 96 |
|
| 97 |
### Compile from source: |
| 98 |
To compile from source, download from the Git repository (`git clone` or downloads from [GitHub releases](https://github.com/htop-dev/htop/releases/)), then run: |
| 99 |
~~~ shell |
| 100 |
./autogen.sh && ./configure && make |
| 101 |
~~~ |
| 102 |
|
| 103 |
### Install |
| 104 |
To install on the local system run `make install`. By default `make install` installs into `/usr/local`. To change this path use `./configure --prefix=/some/path`. |
| 105 |
|
| 106 |
### Build Options |
| 107 |
|
| 108 |
`htop` has several build-time options to enable/disable additional features. |
| 109 |
|
| 110 |
#### Generic |
| 111 |
|
| 112 |
* `--enable-unicode`: |
| 113 |
enable Unicode support |
| 114 |
- dependency: *libncursesw* |
| 115 |
- default: *yes* |
| 116 |
* `--enable-affinity`: |
| 117 |
enable `sched_setaffinity(2)` and `sched_getaffinity(2)` for affinity support; conflicts with hwloc |
| 118 |
- default: *check* |
| 119 |
* `--enable-hwloc`: |
| 120 |
enable hwloc support for CPU affinity; disables affinity support |
| 121 |
- dependency: *libhwloc* |
| 122 |
- default: *no* |
| 123 |
* `--enable-backtrace`: |
| 124 |
enable showing backtraces of a process |
| 125 |
- default: *no* |
| 126 |
- possible values: |
| 127 |
- unwind-ptrace: use **libunwind-ptrace** to get backtraces |
| 128 |
* `--enable-demangling`: |
| 129 |
enable demangling support for backtraces |
| 130 |
- default: *check* |
| 131 |
- possible values: |
| 132 |
- libiberty: use **libiberty** (GNU) to demangle function names |
| 133 |
- libdemangle: use **libdemangle** (Solaris) to demangle function names |
| 134 |
* `--enable-static`: |
| 135 |
build a static htop binary; hwloc and delay accounting are not supported |
| 136 |
- default: *no* |
| 137 |
* `--enable-debug`: |
| 138 |
Enable asserts and internal sanity checks; implies a performance penalty |
| 139 |
- default: *no* |
| 140 |
|
| 141 |
#### Performance Co-Pilot |
| 142 |
|
| 143 |
* `--enable-pcp`: |
| 144 |
enable Performance Co-Pilot support via a new pcp-htop utility |
| 145 |
- dependency: *libpcp* |
| 146 |
- default: *no* |
| 147 |
|
| 148 |
#### Linux |
| 149 |
|
| 150 |
* `--enable-sensors`: |
| 151 |
enable libsensors(3) support for reading temperature data |
| 152 |
- dependencies: *libsensors-dev*(build-time), at runtime *libsensors* is loaded via `dlopen(3)` if available |
| 153 |
- default: *check* |
| 154 |
* `--enable-capabilities`: |
| 155 |
enable Linux capabilities support |
| 156 |
- dependency: *libcap* |
| 157 |
- default: *check* |
| 158 |
* `--with-proc`: |
| 159 |
location of a Linux-compatible proc filesystem |
| 160 |
- default: */proc* |
| 161 |
* `--enable-delayacct`: |
| 162 |
enable Linux delay accounting support |
| 163 |
- dependencies: *libnl-3-dev*(build-time) and *libnl-genl-3-dev*(build-time), at runtime *libnl-3* and *libnl-genl-3* are loaded via `dlopen(3)` if available and requested |
| 164 |
- default: *check* |
| 165 |
|
| 166 |
|
| 167 |
## Runtime dependencies: |
| 168 |
`htop` has a set of fixed minimum runtime dependencies, which is kept as minimal as possible: |
| 169 |
* `ncurses` libraries for terminal handling (wide character support). |
| 170 |
|
| 171 |
### Runtime optional dependencies: |
| 172 |
`htop` has a set of fixed optional dependencies, depending on build/configure option used: |
| 173 |
|
| 174 |
#### Linux |
| 175 |
* `libdl`, if not building a static binary, is always required when support for optional dependencies (i.e. `libsensors`, `libsystemd`) is present. |
| 176 |
* `libcap`, user-space interfaces to POSIX 1003.1e capabilities, is always required when `--enable-capabilities` was used to configure `htop`. |
| 177 |
* `libsensors`, readout of temperatures and CPU speeds, is optional even when `--enable-sensors` was used to configure `htop`. |
| 178 |
* `libsystemd` is optional when `--enable-static` was not used to configure `htop`. If building statically and `libsystemd` is not found by `configure`, support for the systemd meter is disabled entirely. |
| 179 |
* `libnl-3` and `libnl-genl-3`, if `htop` was configured with `--enable-delayacct` and delay accounting process fields are active. |
| 180 |
* I/O counters are available when the kernel is compiled with `CONFIG_TASK_IO_ACCOUNTING=Y`. |
| 181 |
|
| 182 |
`htop` checks for the availability of the actual runtime libraries as `htop` runs. |
| 183 |
|
| 184 |
#### BSD |
| 185 |
On most BSD systems `kvm` is a requirement to read kernel information. |
| 186 |
|
| 187 |
More information on required and optional dependencies can be found in [configure.ac](configure.ac). |
| 188 |
|
| 189 |
## Support |
| 190 |
|
| 191 |
If you have trouble running `htop` please consult your operating system / Linux distribution documentation for getting support and filing bugs. |
| 192 |
|
| 193 |
## Bugs, development feedback |
| 194 |
|
| 195 |
We have a [development mailing list](https://htop.dev/mailinglist.html). Feel free to subscribe for release announcements or asking questions on the development of `htop`. |
| 196 |
|
| 197 |
You can also join our IRC channel [#htop on Libera.Chat](https://web.libera.chat/#htop) and talk to the developers there. |
| 198 |
|
| 199 |
If you have found an issue within the source of `htop`, please check whether this has already been reported in our [GitHub issue tracker](https://github.com/htop-dev/htop/issues). |
| 200 |
If not, please file a new issue describing the problem you have found, the potential location in the source code you are referring to and a possible fix if available. |
| 201 |
|
| 202 |
## History |
| 203 |
|
| 204 |
`htop` was invented, developed and maintained by [Hisham Muhammad](https://hisham.hm/) from 2004 to 2019. His [legacy repository](https://github.com/hishamhm/htop/) has been archived to preserve the history. |
| 205 |
|
| 206 |
In 2020 a [team](https://github.com/orgs/htop-dev/people) took over the development amicably and continues to maintain `htop` collaboratively. |
| 207 |
|
| 208 |
## License |
| 209 |
|
| 210 |
GNU General Public License, version 2 (GPL-2.0) or, at your option, any later version. |