Linux htop command overview

Postgraduate in Communications Engineering with working experience in the Support Desk and self-study in software development.
Search for a command to run...

Postgraduate in Communications Engineering with working experience in the Support Desk and self-study in software development.
top and htop provide a dashboard interface to view running processes similar to a graphical task manager. A dashboard interface can provide an overview but usually does not return directly actionable output. For this, Linux provides another standard ...
The git log command is used to view the commit history of a Git repository. You can customize the output format to show specific details in a more readable or structured way. Below are some useful variations and formatting options for git log: To sh...

Overview This article will teach us how to: Install Ubuntu Server 24.04 on a laptop from scratch Install Ubuntu server by using Vagrant tool with ISO image Prerequisites: A laptop without any OS installed; A virtualization software Virtualbox t...

The /etc/passwd and /etc/shadow files are the backbone of Linux user management. Together, they store user account information and handle authentication securely. This article provides a hands-on guide to understanding these files, their structure, a...

In Linux, links are powerful tools that allow you to create references to files and directories. There are two main types of links: hard links and soft links (also known as symbolic links or symlinks). Understanding the differences between these two ...

A hostname is a human-friendly name given to a computer. It is a unique identifier that allows us to identify the machine in various network communications, making it easier to locate and manage devices. Type: hostname To see where it is stored, typ...

htop is a monitoring tool that allows you to see how much CPU, memory, and swap space your Linux server is using. It also shows you a list of all the processes that are running on your server, and how much CPU and memory each process is using. htop can be used to find out which processes are using the most resources and to kill processes that are misbehaving. It's an alternative to the classic top utility, but with additional features and a more user-friendly interface that allows for easier monitoring and management of system processes.
htopTo use htop, first, install it on your system. On most Linux distributions, you can install htop through the package manager.
sudo apt update
sudo apt install htop
After installation, to start htop, run:
htop
htop and Keyboard ShortcutsIn most cases, servers will not have a mouse attached, so keyboard shortcuts must be learned.
Arrow keys: Move the selection cursor up, down, left, and right to navigate through the list of processes.
PgUp/PgDn: Scroll the process list a page up and down.
Home/End: Jump to the top or bottom of the process list.
Mouse: You can also use the mouse to select items.
F1 or h: Open the help screen, which displays the keyboard shortcuts.
F2 or S: Open setup, where you can configure htop settings, including which columns are displayed.
Right arrow: Move to the next section in the setup menu.
Up and down arrows: Select an item in the setup menu.
Delete: Remove an item from the setup menu.
Enter: Add an item to the setup menu.

F3 or /: Incremental process search. Type the name of the process to highlight it.
F4: Filter processes. Only processes matching the filter will be displayed.

F5 or t: Tree view toggle. Display processes in a tree structure.

F6 or < and \>: Sort processes by different criteria, such as CPU or memory usage. Press F6 then use the arrow keys to select the sort criterion.

F7 and F8: Adjust the nice value (priority) of a process down or up. Lower numbers mean higher priority.
F9: Kill the process

SIGTERM allows a process to clean up and terminate gracefully, making it the preferred method for stopping processes. SIGKILL is more abrupt and should be used as a last resort when a process does not respond to SIGTERM or other more gentle methods of termination, as it does not allow the process to clean up resources, which might lead to system instability or resource leaks.
F10, q, or Ctrl+C: Quit
Space: Tag or untag a process. Tagged processes can be acted on collectively.

U: Untag all processes.
u: Filter the process list by user.

Shift + p: Sort the process list by CPU usage.

Shift + m: Sort the process list by memory usage.
