To install and use the htop command on YUM-based Linux distributions like CentOS and AlmaLinux, follow these steps:
Step 1: Install `htop`
1. Check if `htop` is available in your system’s default repository.
On most YUM-based systems, `htop` is available and can be installed directly from the official repositories.
# yum install htop
Step 2: Launch `htop`
Once installed, you can start `htop` by simply running:
# htop
Key Features
- CPU and Memory Usage: `htop` shows CPU and memory usage in a graphical bar.
- Process List: Displays a list of active processes, including PID, user, memory usage, CPU usage, etc.
- Interactive Navigation: You can scroll through the list, sort by memory, CPU usage, or other parameters, and even kill processes directly from `htop`.
Common `htop` Commands
- Arrow Keys: Navigate through processes.
- F6: Sort processes by criteria (CPU, memory, etc.).
- F9: Kill a selected process.
- F10: Exit `htop`
Exiting `htop`
Press `F10` or `q` to exit the `htop` application.
This should give you a good start on using `htop` to monitor and manage system resources interactively!