Htop in Linux | Real-Time System Monitoring Commands

Htop is a useful terminal-based system monitoring tool for Linux. It gives you a live view of CPU usage, memory usage, running processes, and system activity. Its simple interface makes it easy to find processes, sort information, check resource usage, and monitor your system from the terminal without using a graphical application.

Here’s what you can do with Htop:

  • Monitor CPU and memory usage.
  • View running processes.
  • Sort processes by different columns.
  • Search and filter processes.
  • View processes in a tree structure.
  • Monitor specific processes using their PIDs.
  • Show processes for a specific user.
  • Change the refresh delay.
  • Run Htop with a monochrome display.

Install Htop in Linux

You can install htop using one simple command according to your Linux system, below are the commands to install htop on Debian-based Linux distributions, Fedora, and Arch Linux.

sudo apt update
sudo apt install htop -y

On Fedora:

sudo dnf install htop -y

On Arch Linux:

sudo pacman -S htop

Check the installed version:

htop --version

Htop Usage Commands

Once htop is installed, you can use different commands and options to monitor your system. Below are some useful htop commands that you can run in the terminal.

Start Htop:

htop

Run Htop without colors:

htop -C

Set the delay between updates:

htop -d 20

The delay value is measured in tenths of a second.

Show only commands matching a filter:

htop -F firefox

Hide the function bar:

htop --no-function-bar

Highlight new and old processes:

htop -H

Disable the mouse:

htop -M

Hide the system meters:

htop --no-meters

Exit Htop after a specific number of updates:

htop -n 5

Show only specific processes using their PIDs:

htop -p 1234,5678

Run Htop in read-only mode:

htop --readonly

Sort processes by a specific column:

htop -s PERCENT_CPU

Show the available sorting columns:

htop -s help

Show processes in a tree view:

htop -t

Use the classic tree view:

htop -t classic

Show processes for a specific user:

htop -u username

Show processes for the current user:

htop -u "$USER"

Disable Unicode characters:

htop -U

Show Htop help:

htop -h

Show the Htop version:

htop -V

You can also press F1 while Htop is running to open its online help.

For more information, use the manual page:

man htop

These htop commands are useful for checking running processes and system resources in the terminal. You can try different options to view the information you need and monitor your Linux system.

Conclusion

Htop is a simple tool for monitoring your Linux system from the terminal, it shows CPU usage, memory usage, running processes, and other useful system information in one place, you can use its commands and options to check system activity, find processes, and understand how your Linux system is performing

SHARE THIS POST: