How to install htop on Arch Linux

I am a new user of Arch Linux operating system. How do I install htop on Arch Linux using the pacman command?

The htop is nothing but Interactive process viewer for Arch Linux based system. It is just like default top command with an additional set of options and better display on the screen. This page shows how to install htop on Arch Linux using command line options.

ADVERTISEMENTS

How to install htop on Arch Linux using pacman

The procedure for installing htop Arch Linux is as follows:

  1. Open the terminal window/application.
  2. For remote Arch Linux server login using ssh command.
  3. Execute pacman -Ss htop command to search for htop on Arch Linux
  4. Run sudo pacman -S htop to install htop in Arch Linux

Let us see all commands and examples in details.

Please note that vivek@desktop:$ is my shell prompt. You need to type all commands after that prompt.

Arch Linux install htop

It is important that you know how to search for any packages. Therefore type the following command to search for htop package using pacman command:
vivek@desktop:$ sudo pacman -Ss htop
Sample outputs:

extra/htop 2.2.0-3
    Interactive process viewer
community/bashtop 0.9.24-1
    Linux resource monitor
community/nvtop 1.0.0-2
    An htop like monitoring tool for NVIDIA GPUs

Find information about htop package

Run the following command:
vivek@desktop:$ sudo pacman -Si htop

Repository      : extra
Name            : htop
Version         : 2.2.0-3
Description     : Interactive process viewer
Architecture    : x86_64
URL             : https://hisham.hm/htop/
Licenses        : GPL
Groups          : None
Provides        : None
Depends On      : ncurses  libnl
Optional Deps   : lsof: show files opened by a process
                  strace: attach to a running process
Conflicts With  : None
Replaces        : None
Download Size   : 83.89 KiB
Installed Size  : 199.27 KiB
Packager        : Christian Hesse <arch@eworm.de>
Build Date      : Tue 21 Jan 2020 08:12:00 PM UTC
Validated By    : MD5 Sum  SHA-256 Sum  Signature

Installing htop on Arch Linux

First, make sure you system is up to date:
vivek@desktop:$ sudo pacman -Syu
Finally, run the following to install htop on Arch Linux:
vivek@desktop:$ sudo pacman -S htop

Install htop on Arch Linux using pacman command

Installing htop on Arch Linux box

How to use htop command

The syntax is:
htop
htop [options] htop [options] arg1 arg2 argN

Running htop on Arch Linux server

htop in action

Press F10 or q to quit htop session.

One can use a monochrome color scheme, run:

vivek@desktop:$ htop -C
vivek@desktop:$ htop --no-color

Want to see the tree view by default when running htop? Try:

vivek@desktop:$ htop -t
vivek@desktop:$ htop --tree

Let us see only processes of a given user named tina:
vivek@desktop:$ htop -u tina
vivek@desktop:$ htop --user=tina
vivek@desktop:$ htop --user=mysql

Limit and show process for only the given PIDs:
vivek@desktop:$ htop -p PID
vivek@desktop:$ htop -p PID1,PID2
vivek@desktop:$ htop --pid=PID,[,PID,PID...] vivek@desktop:$ htop -p 3754
vivek@desktop:$ htop -p 6876,8618

Arch Linux htop keyboard shortcut keys

The following commands are supported while in htop:

CommandDescription
Up arrow keySelect (highlight) the previous process in the process list. Scroll the list if necessary.
Down arrow keySelect (highlight) the next process in the process list. Scroll the list if necessary.
Left arrow keyScroll the process list left.
Right arrow keyScroll the process list right.
PgUp, PgDnScroll the process list up or down one window.
HomeScroll to the top of the process list and select the first process.
EndScroll to the bottom of the process list and select the last process.
sTrace process system calls: if strace(1) is installed, pressing this key will attach it to the currently selected process, presenting a live update of system calls issued by the process.
lDisplay open files for a process: if lsof(1) is installed, pressing this key will display the list of file descriptors opened by the process.

Other keyboard shortcuts

uShow only processes owned by a specified user.
MSort by memory usage (top compatibility key).
PSort by processor usage (top compatibility key).
TSort by time (top compatibility key).
F“Follow” process: if the sort order causes the currently selected process to move in the list, make the selection bar follow it. This is useful for monitoring a process: this way, you can keep a process always visible on screen. When a movement key is used, “follow” loses effect.
KHide kernel threads: prevent the threads belonging the kernel to be displayed in the process list. (This is a toggle key.)
HHide user threads: on systems that represent them differently than ordinary processes (such as recent NPTL-based systems), this can hide threads from userspace processes in the process list. (This is a toggle key.)
pShow full paths to running programs, where applicable. (This is a toggle key.)
Ctrl-LRfresh the screen.
F1See this help menu.

How to get help about htop

Simply pass the --help option. For example:
vivek@desktop:$ htop --help
vivek@desktop:$ man htop

Conclusion

This page showed you how to install and use htop on Arch Linux Unix server. It has many more option. Hence, see the htop home page online or read man page by typing the following man command:
$ man htop

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.