htop command in Linux with examples
Last Updated :
06 Oct, 2024
htop command in Linux system is a command line utility that allows the user to interactively monitor the system’s vital resources or server’s processes in real-time. htop is a newer program compared to top command, and it offers many improvements over top command. htop supports mouse operation, uses color in its output, and gives visual indications about processor, memory, and swap usage. htop also prints full command lines for processes and allows one to scroll both vertically and horizontally for processes and command lines respectively.
Syntax
htop
This will open an interactive interface showing all running processes, along with CPU, memory, and swap usage. You can also specify options when launching htop.
Basic Example:

Common Options used with htop command
Here are some of the most commonly used options with htop:
Option
|
Description
|
-d <delay>
|
sets the delay between updates (delay of some sec)
|
-u <user>
|
displays only the process which owned by the user
|
-p <pid>
|
shows only process with specific ids.
|
-s <column>
|
sorts the process of the given column
|
-t
|
displays the process hierarchy in tree view in the commands column
|
–no-color
|
Runs htop in monochrome mode, disabling color
|
htop command Examples in Linux
1. htop -d <delay>:
htop -d 10 means shows delay between screen updates in 1 second. If you give delay as 15 means delay of 1.5 sec, similarly 23 means 2.3 sec etc. This delay is useful as it reduce frequent updates.


After adding delay of 30