Learn how to install htop, a powerful system monitoring tool, on your Linux system with this comprehensive tutorial. Discover the step-by-step process to download htop in Linux and unleash its real-time monitoring capabilities for CPU usage, memory consumption, and more. htop can help node runners to monitor hardware usage of the machines your blockchain nodes are running in.
Step 1: Update System Packages for Hassle-Free Installation
Start by updating your system's package manager and repositories to ensure a smooth installation process. Open the terminal and execute this command:
sudo apt update
Step 2: Easy Installation Steps for htop
To install htop on Debian-based distributions like Ubuntu, Linux Mint, or Debian itself, use this command:
sudo apt install htop
For installing htop on Fedora, CentOS, or Red Hat-based distributions, employ this command:
sudo dnf install htop
Step 3: Check htop installed on linux
After the installation completes, it's important to verify that htop is functioning correctly. Simply open a terminal and type:
A working htop interface displaying real-time system resource information confirms the installation's success.
Step 4: Get Familiar with Basic htop Usage
Once htop is installed, acquaint yourself with its user-friendly interface for monitoring system resources. Here are essential commands to navigate through htop:
- Scroll through the process list using the arrow keys (up and down).
- Gain detailed insights about a specific process by pressing Enter.
- Access the htop help menu by pressing F1 or the "?" key.
How to exit htop in linux?
To quit or exit htop in linux and return to the terminal you need to press the F10 or q key in your keyboard.
Step 5: Customize htop for Your Preferences
htop offers customization options to tailor the display to your liking. To access htop settings, press F2 while in the htop interface. Customize the following key settings:
- Columns: Navigate to the "Columns" section and select the columns to display, such as CPU%, MEM%, TIME+, etc.
- Sorting: Choose how processes are sorted by accessing the "Sorting" section, sorting options include CPU usage, memory usage, process ID, and more.
- Color Schemes: Under the "Colors" section, select different color schemes that appeal to your visual preferences.
Once customization is complete, save the settings by pressing F10, ensuring an optimized htop display.
htop Command in Linux
Now that we are familiar with the interface, let's explore some useful features and commands within
Sorting Processes: By default, processes are sorted by CPU usage. Modify the sorting method by pressing the following keys:
t: Sort by process tree.
P: Sort by CPU usage.
M: Sort by memory usage.
N: Sort by process name.
U: Sort by user.
K: Sort by process ID.
- Navigating the Process List: Scroll through the process list using the arrow keys (
Down). To scroll one page at a time, press
PgDn. For quick navigation to the top or bottom of the list, use
- Killing Processes: If you need to terminate a running process, select it using the arrow keys and press
k. Confirm the action by pressing
Enter, and the process will be terminated.
- Monitoring CPU and Memory Usage: The header displays CPU usage as a horizontal bar graph, while memory usage is represented by a bar graph below it. Monitor these graphs in real-time to assess system health.
Step 6: Keep htop Updated for Enhanced Performance
Stay up-to-date with the latest htop version, which includes bug fixes and additional features. Update htop using your package manager's update command. For example, on Debian-based systems, run:
sudo apt update
sudo apt upgrade htop