htop: Graphical representation similar to a task manager
August 9th, 2024 1:44 PM Mr. Q Categories: Command
Command: htop
The htop
command provides an interactive, ncurses-based graphical representation of system processes, similar to a task manager. It offers an enhanced view compared to top
, with a more user-friendly interface and additional features for managing processes.
Sample Commands and Outputs:
- Command:
htop
Sample Command:
$ htop
Sample Output:
[htop output starts]
1 [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 15.5%]
2 [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 16.7%]
3 [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 14.4%]
4 [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 13.8%]
Mem[|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 83.5%]
Swp[|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 0.0%]
PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ COMMAND
1234 user 20 0 123M 50M 12M S 10.2 1.5 0:05.23 firefox
5678 user 20 0 789M 120M 25M R 15.4 3.1 0:10.11 code
9101 root 20 0 345M 67M 11M S 0.5 0.8 0:01.05 sshd
1122 user 20 0 678M 88M 17M S 3.2 1.0 0:02.34 gnome-shell
[htop output ends]
Description:
- CPU and Memory Usage Bars: Graphical bars at the top show overall CPU and memory usage.
- Process List: Displays detailed information about processes, including PID, user, priority, CPU and memory usage, and command.
- Interactive Controls: Use arrow keys to navigate, and function keys for various actions:
- F1: Help
- F2: Setup
- F3: Search
- F4: Filter
- F5: Tree view
- F6: Sort by column
- F9: Send signal
Installation:
To install htop
if it’s not already present on your system, you can use your package manager:
- Debian/Ubuntu:
sudo apt-get install htop
- Red Hat/CentOS:
sudo yum install htop
orsudo dnf install htop
- Arch Linux:
sudo pacman -S htop