htop command in Linux

Htop is an interactive process viewer that provides a tree-structured display for Linux. It can be used to identify and classify processes and thread activity and manage running kernels.

Htop is a command-line tool that makes it easier to monitor your system and see what’s going on. You can do things like track tasks, see processes by PID, and get information about uptime, memory utilization, and more.

htop is a great tool that stands out from the command line program top. It allows you to better monitor your system, with more organized displays and different colors, making it easy to find whatever you’re looking for. It’s available across all Linux distributions and in most cases, will already be installed on most new Linux/Unix environments.

Htop is a system utility that you can use to see key system metrics. To begin using htop, type “htop” and once executed, the command will display various metrics like:

$ htop

Htop is a process-tracking tool designed specifically for Linux/Unix environments. It was written in C and has a nice, intuitive GUI. Compared to top, Htop is more interactive and provides you with real-time information that’s helpful for diagnosing system issues.

Htop has more comprehensive support than the top and also includes more of the following features:

  • In the ‘htop’ app, you can scroll vertically to see more processes and lines of command.

  • The loading times of this app are much faster than other apps in the market because it doesn’t wait for data to load during startup.

  • When comparing htop to other apps, you can see that it makes the process of killing more than one process at a time easier.

  • You can now re-niche processes in htop by process name or process ID.

  • Press “e” to display a list of all the current environment variables in the terminal.

  • Click the list items with the mouse

Install Htop in Linux

Htop is available for most Linux distributions. To install it, you can use the default package manager of your system.

Install Htop on Debian

$ sudo apt install htop

Install Htop on Ubuntu

$ sudo apt install htop

Install Htop on Linux Mint

$ sudo apt install htop

Install Htop on Fedora

$ sudo dnf install htop

Install Htop on CentOS 8/7

$ sudo yum install epel-release
$ sudo yum install htop

Install Htop on RHEL 8/7

--------- On RHEL 8 --------- 
$ sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
$ sudo yum install htop

--------- On RHEL 7 ---------
$ sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ sudo yum install htop

Install Htop on Rocky Linux/AlmaLinux

$ sudo yum install epel-release
$ sudo yum install htop

Install Htop on Gentoo

$ emerge sys-process/htop

Install Htop on Arch Linux

$ pacman -S htop

Install Htop on OpenSUSE

$ sudo zypper install htop

Syntax:

htop

Options:

  • -d –delay: Used to show the delay between updates, in tenths of seconds.
  • -C –no-color –no-color: Start htop in monochrome mode.
  • -h –help: Used to display the help message and exit.
  • -u –user=USERNAME: Used to show only the processes of a given user.
    $ htop -u root

 

  • -p –pid=PID, PID…: Used to show only the given PIDs.
  • -s –sort-key COLUMN: Sort by this column (use –sort-key help for a column list).
  • -v –version: Output version information and exit.
  • Arrows, Page Up, Page Down, Home, End: Scroll the process list.
  • Space: Tag or untag a process.
  • U – Untag all processes (remove all tags added with the Space key).
  • s – Trace process system calls.
  • F1 – Help
  • F2 – setup
  • F3 – search
  • F4 – filtering: type in part of a process command line and only processes whose names match will be shown.
  • F5 – Tree view.
  • F6 – Sorting.
  • F7 – Increase the selected process’s priority. This can only be done by the superuser.
  • F8 – Decrease the selected process’s priority.
  • F9 – Kill process.
  • F10 – Quit.

And that’s it for the main part of this tutorial. Feel free to post a comment and share it with your friends to get their opinion.🙂

Leave a Comment