htop - an interactive process viewer
Go to file
Anton Soroko c63dc63a71 Fix "CPU usage bar" help alignment. 2024-04-23 14:08:30 +02:00
.github CI: (OpenBSD) Detect latest Autoconf & Automake versions 2024-04-15 09:33:21 +02:00
darwin darwin: scan thread information 2024-04-21 10:55:43 +02:00
docs Document compilation issues and changed config.h inclusion rules 2023-12-26 15:14:19 +01:00
dragonflybsd Work around GCC14 memleak diagnostic 2024-04-08 18:38:34 +02:00
freebsd Work around GCC14 memleak diagnostic 2024-04-08 18:38:34 +02:00
generic Use 'fp' name for local 'FILE*' variables. 2024-04-17 11:54:00 +02:00
iwyu Update list of special header mappings for IWYU 2023-12-26 15:14:19 +01:00
linux Merge branch 'gcc14-analyzer-fixes' of BenBE/htop 2024-04-18 22:02:38 +02:00
netbsd Work around GCC14 memleak diagnostic 2024-04-08 18:38:34 +02:00
openbsd Work around GCC14 memleak diagnostic 2024-04-08 18:38:34 +02:00
pcp Work around GCC14 memleak diagnostic 2024-04-08 18:38:34 +02:00
scripts Suppress reporting memory leaks originating from libdevstat 2021-10-14 23:25:19 +02:00
solaris Work around GCC14 memleak diagnostic 2024-04-08 18:38:34 +02:00
unsupported Introduce autoTitleRightAlign column flag 2024-03-27 19:49:23 +01:00
zfs Relocate include of config.h from header to source modeule 2023-12-26 15:14:19 +01:00
.editorconfig Add `trim_trailing_whitespace` to editorconfig 2019-10-31 11:39:57 -05:00
.gitignore Ignore clangd cache 2022-12-26 17:53:46 +01:00
.travis.yml travis-ci: update 2021-09-02 08:03:21 +02:00
AUTHORS Update AUTHORS file with htop-dev team 2020-12-05 11:07:32 +01:00
Action.c Fix "CPU usage bar" help alignment. 2024-04-23 14:08:30 +02:00
Action.h Relocate include of config.h from header to source modeule 2023-12-26 15:14:19 +01:00
Affinity.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
Affinity.h Relocate include of config.h from header to source modeule 2023-12-26 15:14:19 +01:00
AffinityPanel.c Fix code style 2023-12-26 15:14:19 +01:00
AffinityPanel.h Introduce Machine class for host-specific info (split from ProcessList) 2023-05-08 13:06:07 +10:00
AvailableColumnsPanel.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
AvailableColumnsPanel.h Update includes based on IWYU 2023-12-26 15:14:19 +01:00
AvailableMetersPanel.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
AvailableMetersPanel.h Introduce Machine class for host-specific info (split from ProcessList) 2023-05-08 13:06:07 +10:00
BatteryMeter.c Fix code style 2023-12-26 15:14:19 +01:00
BatteryMeter.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
CONTRIBUTING.md Adjust to current label reality and the fact that Github can't search for multiple labels ORed ... yet. 2021-05-14 11:29:29 +02:00
COPYING Remove license excemption for PLPA and update GPL-2 license text 2021-08-26 11:37:36 +02:00
CPUMeter.c Define MeterModeId to unsigned int and use it throughout 2024-04-20 19:36:00 +02:00
CPUMeter.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
CRT.c Avoid fprintf in signal handlers 2024-04-13 21:46:04 +02:00
CRT.h Linux: add GPU meter and process column 2024-03-27 19:49:23 +01:00
CategoriesPanel.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
CategoriesPanel.h Introduce Machine class for host-specific info (split from ProcessList) 2023-05-08 13:06:07 +10:00
ChangeLog Release 3.3.0 2024-01-10 10:54:15 +01:00
ClockMeter.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
ClockMeter.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
ColorsPanel.c Relocate include of config.h from header to source modeule 2023-12-26 15:14:19 +01:00
ColorsPanel.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
ColumnsPanel.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
ColumnsPanel.h Update includes based on IWYU 2023-12-26 15:14:19 +01:00
CommandLine.c Print message if config file was resolved 2024-03-12 19:03:58 +01:00
CommandLine.h Refactor to use a program name pointer instead of PACKAGE macro 2023-04-06 00:19:54 +02:00
CommandScreen.c Merge branch 'style-header-consistency' of https://github.com/BenBE/htop into BenBE-style-header-consistency 2023-10-10 20:45:54 +11:00
CommandScreen.h Add missing copyright/file headers 2023-05-25 08:59:32 +02:00
Compat.c Use 'sb' name for local 'struct stat' buffers 2024-04-17 11:54:00 +02:00
Compat.h Update '__STDC_VERSION__' check with C23 2024-04-22 13:41:26 +02:00
DateMeter.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
DateMeter.h Update remaining license headers to explicitly say GPLv2+ 2021-09-24 20:28:26 +02:00
DateTimeMeter.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
DateTimeMeter.h Update remaining license headers to explicitly say GPLv2+ 2021-09-24 20:28:26 +02:00
DiskIOMeter.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
DiskIOMeter.h Update includes based on IWYU 2023-12-26 15:14:19 +01:00
DisplayOptionsPanel.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
DisplayOptionsPanel.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
DynamicColumn.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
DynamicColumn.h Rename ProcessList to ProcessTable throughout 2023-08-31 14:13:16 +10:00
DynamicMeter.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
DynamicMeter.h Add missing copyright/file headers 2023-05-25 08:59:32 +02:00
DynamicScreen.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
DynamicScreen.h Align parameter names in declarations with definitions 2024-04-08 18:12:39 +02:00
EnvScreen.c Merge branch 'style-header-consistency' of https://github.com/BenBE/htop into BenBE-style-header-consistency 2023-10-10 20:45:54 +11:00
EnvScreen.h Add missing copyright/file headers 2023-05-25 08:59:32 +02:00
FileDescriptorMeter.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
FileDescriptorMeter.h Create new File Descriptor meter 2023-02-19 17:56:50 +01:00
FunctionBar.c Avoid magic numbers for the size of FunctionBar lists 2024-04-18 10:13:33 +02:00
FunctionBar.h Avoid magic numbers for the size of FunctionBar lists 2024-04-18 10:13:33 +02:00
Hashtable.c Use designated initializer more 2024-04-05 19:25:20 +02:00
Hashtable.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
Header.c Use struct member to determine size of allocations 2024-04-20 19:36:00 +02:00
Header.h Update includes based on IWYU 2023-12-26 15:14:19 +01:00
HeaderLayout.h Add HeaderLayout format for one single 100%-width column 2024-04-17 09:09:48 +02:00
HeaderOptionsPanel.c Relocate include of config.h from header to source modeule 2023-12-26 15:14:19 +01:00
HeaderOptionsPanel.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
HostnameMeter.c Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
HostnameMeter.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
IncSet.c Improve String_contains_i to allow for multiple terms 2022-03-25 17:19:59 +01:00
IncSet.h Increase Search and Filter max string length to 128 2023-03-29 10:43:58 +02:00
InfoScreen.c Fix code style 2023-12-26 15:14:19 +01:00
InfoScreen.h Add missing copyright/file headers 2023-05-25 08:59:32 +02:00
ListItem.c Introduce screen tabs 2021-12-07 17:04:49 +11:00
ListItem.h Update includes based on IWYU 2023-12-26 15:14:19 +01:00
LoadAverageMeter.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
LoadAverageMeter.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
Machine.c Fix regression from storing monotonic time deltas 2024-04-05 19:07:06 +02:00
Machine.h Align parameter names in declarations with definitions 2024-04-08 18:12:39 +02:00
Macros.h Clarify isNonnegative() behavior in comments 2024-01-08 13:13:29 +01:00
MainPanel.c Clicking on column headers needs to also update the sort direction arrow 2024-01-17 10:18:31 +01:00
MainPanel.h Relocate include of config.h from header to source modeule 2023-12-26 15:14:19 +01:00
Makefile.am New header "MeterMode.h" for MeterModeId definitions 2024-04-20 19:36:00 +02:00
MemoryMeter.c Relocate include of config.h from header to source modeule 2023-12-26 15:14:19 +01:00
MemoryMeter.h Move shared memory next to used memory 2023-10-26 03:14:33 +04:00
MemorySwapMeter.c MemorySwapMeter_init() code shrink 2024-04-20 19:36:00 +02:00
MemorySwapMeter.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
Meter.c Adjust some code style for maintainability 2024-04-20 19:36:00 +02:00
Meter.h Define MeterModeId to unsigned int and use it throughout 2024-04-20 19:36:00 +02:00
MeterMode.h Define MeterModeId to unsigned int and use it throughout 2024-04-20 19:36:00 +02:00
MetersPanel.c Define MeterModeId to unsigned int and use it throughout 2024-04-20 19:36:00 +02:00
MetersPanel.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
NEWS Remove trailing whitespaces 2020-08-21 10:37:33 +02:00
NetworkIOMeter.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
NetworkIOMeter.h Update includes based on IWYU 2023-12-26 15:14:19 +01:00
Object.c Relocate include of config.h from header to source modeule 2023-12-26 15:14:19 +01:00
Object.h Relocate include of config.h from header to source modeule 2023-12-26 15:14:19 +01:00
OpenFilesScreen.c Use 'sb' name for local 'struct stat' buffers 2024-04-17 11:54:00 +02:00
OpenFilesScreen.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
OptionItem.c Add includes for config.h as per the discussion in PR #1337 2023-12-26 15:14:19 +01:00
OptionItem.h Add some headers in the Setup -> Display options panel 2022-05-27 19:47:06 +02:00
Panel.c Fix code style 2023-12-26 15:14:19 +01:00
Panel.h Relocate include of config.h from header to source modeule 2023-12-26 15:14:19 +01:00
Process.c Linux: gather permitted capabilities via capget(2) 2024-04-06 19:42:28 +02:00
Process.h Align parameter names in declarations with definitions 2024-04-08 18:12:39 +02:00
ProcessLocksScreen.c Introduce Row and Table classes for screens beyond top-processes 2023-08-30 13:11:57 +10:00
ProcessLocksScreen.h Use a 0x{devnum} format for devices in lock screen, like files screen 2023-01-08 18:22:10 +01:00
ProcessTable.c Relocate include of config.h from header to source modeule 2023-12-26 15:14:19 +01:00
ProcessTable.h Relocate include of config.h from header to source modeule 2023-12-26 15:14:19 +01:00
ProvideCurses.h Fix typo in file name comment in Provide*.h 2023-08-31 14:13:28 +10:00
ProvideTerm.h Fix typo in file name comment in Provide*.h 2023-08-31 14:13:28 +10:00
README README: swap regular file and symlink 2024-03-27 21:18:01 +01:00
README.md linux: use dlopen for libnl3 instead of dynamic linking 2024-04-05 19:27:07 +02:00
RichString.c Properly handle RichString_extendLen when an external buffer already exists 2024-04-07 01:22:00 +02:00
RichString.h RichString: add access function annotations 2024-01-20 11:53:25 +01:00
Row.c Drop return at end of function returning void 2024-04-08 18:12:39 +02:00
Row.h New Row_printNanoseconds() function 2024-04-05 19:27:59 +02:00
RowField.h Introduce Row and Table classes for screens beyond top-processes 2023-08-30 13:11:57 +10:00
Scheduling.c Linux: update gathering information regarding threads 2024-04-06 19:42:28 +02:00
Scheduling.h Relocate include of config.h from header to source modeule 2023-12-26 15:14:19 +01:00
ScreenManager.c Ignore FOCUS_IN and FOCUS_OUT events if these have been activated within xterm 2024-03-14 20:34:47 +01:00
ScreenManager.h Introduce Machine class for host-specific info (split from ProcessList) 2023-05-08 13:06:07 +10:00
ScreenTabsPanel.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
ScreenTabsPanel.h Update includes based on IWYU 2023-12-26 15:14:19 +01:00
ScreensPanel.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
ScreensPanel.h Support dynamic screens with 'top-most' entities beyond processes 2023-08-30 13:11:57 +10:00
Settings.c Use struct member to determine size of allocations 2024-04-20 19:36:00 +02:00
Settings.h Define MeterModeId to unsigned int and use it throughout 2024-04-20 19:36:00 +02:00
SignalsPanel.c Add includes for config.h as per the discussion in PR #1337 2023-12-26 15:14:19 +01:00
SignalsPanel.h Relocate include of config.h from header to source modeule 2023-12-26 15:14:19 +01:00
SwapMeter.c Replace isnan() with better comparisons (isgreater(), etc.) 2023-08-18 12:52:28 +02:00
SwapMeter.h {Memory,Swap}Meter: add "compressed memory" metrics 2023-04-23 16:00:17 +02:00
SysArchMeter.c Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
SysArchMeter.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
TESTPLAN Rename ProcessList to ProcessTable throughout 2023-08-31 14:13:16 +10:00
Table.c Fix usage of RichString_appendnWide() 2024-01-20 11:53:25 +01:00
Table.h Relocate include of config.h from header to source modeule 2023-12-26 15:14:19 +01:00
TasksMeter.c Update includes based on IWYU 2023-12-26 15:14:19 +01:00
TasksMeter.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
TraceScreen.c Use 'fp' name for local 'FILE*' variables. 2024-04-17 11:54:00 +02:00
TraceScreen.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
UptimeMeter.c Add includes for config.h as per the discussion in PR #1337 2023-12-26 15:14:19 +01:00
UptimeMeter.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
UsersTable.c Please Clang 15 2022-08-09 20:30:05 +02:00
UsersTable.h Update license headers to explicitly say GPLv2+ 2021-09-22 14:28:19 +02:00
Vector.c Use designated initializer more 2024-04-05 19:25:20 +02:00
Vector.h ProcessList: fix quadratic process removal when scanning 2022-05-05 09:17:51 +02:00
XUtils.c Use 'fp' name for local 'FILE*' variables. 2024-04-17 11:54:00 +02:00
XUtils.h Use 'fp' name for local 'FILE*' variables. 2024-04-17 11:54:00 +02:00
autogen.sh autotools: enable warnings and cleanup 2020-09-17 21:45:11 +02:00
configure.ac Update configure.ac with some m4 magic to add a git commit id 2024-04-16 19:06:40 +02:00
htop.1.in documentation update "pcp htop" –> "pcp-htop" 2024-02-28 16:34:38 -05:00
htop.c Refactor to use a program name pointer instead of PACKAGE macro 2023-04-06 00:19:54 +02:00
htop.desktop Add danish translation to htop.desktop 2019-02-19 01:25:52 +01:00
htop.png Optimize images to reduce filesize 2022-08-30 01:30:48 +02:00
htop.svg Update htop logo, provide .svg file as well 2020-12-05 13:46:34 +01:00
pcp-htop.5.in Updates for 2024. Happy New Year! 2024-01-01 02:12:06 +01:00
pcp-htop.c Refactor to use a program name pointer instead of PACKAGE macro 2023-04-06 00:19:54 +02:00
test_spec.lua Remove trailing whitespaces 2020-08-21 10:37:33 +02:00

README.md

htop logo

CI Coverity Scan Build Status Mailing List IRC #htop GitHub Release Packaging status License: GPL v2+

Screenshot of htop

Introduction

htop is a cross-platform interactive process viewer.

htop allows scrolling the list of processes vertically and horizontally to see their full command lines and related information like memory and CPU consumption. Also system wide information, like load average or swap usage, is shown.

The information displayed is configurable through a graphical setup and can be sorted and filtered interactively.

Tasks related to processes (e.g. killing and renicing) can be done without entering their PIDs.

Running htop requires ncurses libraries, typically named libncurses(w).

htop is written in C.

For more information and details visit htop.dev.

Build instructions

Prerequisite

List of build-time dependencies:

  • standard GNU autotools-based C toolchain
    • C99 compliant compiler
    • autoconf
    • automake
    • autotools
  • ncurses

Note about ncurses:

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:

  • With Unicode support.
  • Without Unicode support.

This is also something that is reflected in the package name on Debian/Ubuntu (via the additional 'w' - 'w'ide character support).

List of additional build-time dependencies (based on feature flags):

  • sensors
  • hwloc
  • libcap (v2.21 or later)
  • libnl-3 and libnl-genl-3

Install these and other required packages for C development from your package manager.

Debian/Ubuntu

sudo apt install libncursesw5-dev autotools-dev autoconf automake build-essential

Fedora/RHEL

sudo dnf install ncurses-devel automake autoconf gcc

Archlinux/Manjaro

sudo pacman -S ncurses automake autoconf gcc

macOS

brew install ncurses automake autoconf gcc

Compile from source:

To compile from source, download from the Git repository (git clone or downloads from GitHub releases), then run:

./autogen.sh && ./configure && make

Install

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.

Build Options

htop has several build-time options to enable/disable additional features.

Generic

  • --enable-unicode: enable Unicode support
    • dependency: libncursesw
    • default: yes
  • --enable-affinity: enable sched_setaffinity(2) and sched_getaffinity(2) for affinity support; conflicts with hwloc
    • default: check
  • --enable-hwloc: enable hwloc support for CPU affinity; disables affinity support
    • dependency: libhwloc
    • default: no
  • --enable-static: build a static htop binary; hwloc and delay accounting are not supported
    • default: no
  • --enable-debug: Enable asserts and internal sanity checks; implies a performance penalty
    • default: no

Performance Co-Pilot

  • --enable-pcp: enable Performance Co-Pilot support via a new pcp-htop utility
    • dependency: libpcp
    • default: no

Linux

  • --enable-sensors: enable libsensors(3) support for reading temperature data
    • dependencies: libsensors-dev(build-time), at runtime libsensors is loaded via dlopen(3) if available
    • default: check
  • --enable-capabilities: enable Linux capabilities support
    • dependency: libcap
    • default: check
  • --with-proc: location of a Linux-compatible proc filesystem
    • default: /proc
  • --enable-openvz: enable OpenVZ support
    • default: no
  • --enable-vserver: enable VServer support
    • default: no
  • --enable-ancient-vserver: enable ancient VServer support (implies --enable-vserver)
    • default: no
  • --enable-delayacct: enable Linux delay accounting support
    • 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
    • default: check

Runtime dependencies:

htop has a set of fixed minimum runtime dependencies, which is kept as minimal as possible:

  • ncurses libraries for terminal handling (wide character support).

Runtime optional dependencies:

htop has a set of fixed optional dependencies, depending on build/configure option used:

Linux

  • libdl, if not building a static binary, is always required when support for optional dependencies (i.e. libsensors, libsystemd) is present.
  • libcap, user-space interfaces to POSIX 1003.1e capabilities, is always required when --enable-capabilities was used to configure htop.
  • libsensors, readout of temperatures and CPU speeds, is optional even when --enable-sensors was used to configure htop.
  • 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.
  • libnl-3 and libnl-genl-3, if htop was configured with --enable-delayacct and delay accounting process fields are active.

htop checks for the availability of the actual runtime libraries as htop runs.

BSD

On most BSD systems kvm is a requirement to read kernel information.

More information on required and optional dependencies can be found in configure.ac.

Usage

See the manual page (man htop) or the help menu (F1 or h inside htop) for a list of supported key commands.

Support

If you have trouble running htop please consult your operating system / Linux distribution documentation for getting support and filing bugs.

Bugs, development feedback

We have a development mailing list. Feel free to subscribe for release announcements or asking questions on the development of htop.

You can also join our IRC channel #htop on Libera.Chat and talk to the developers there.

If you have found an issue within the source of htop, please check whether this has already been reported in our GitHub issue tracker. 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.

History

htop was invented, developed and maintained by Hisham Muhammad from 2004 to 2019. His legacy repository has been archived to preserve the history.

In 2020 a team took over the development amicably and continues to maintain htop collaboratively.

License

GNU General Public License, version 2 (GPL-2.0) or, at your option, any later version.