Install HTop on Ubuntu

28/12/2020
htop is a system monitoring utility that runs on the terminal. It is similar to another commonly used utility called top. But htop is much easier to use. htop program’s user interface is ncurses based and the information representation is really clean and nice. That’s why many people, including myself like htop. You can also filter, manage and do other cool stuff on the running processes with htop utility. It is a great tool for Linux system administrators.

In this article, I will show you how to install htop on Ubuntu 17.10 Artful Aardvark and how to use htop. Let’s get started.

Installing htop

First update the package repository cache of your Ubuntu operating system with the following command:

$ sudo apt-get update

The package repository cache should be updated.

htop is available on the official package repository of Ubuntu 17.10 Artful Aardvark. To install htop, run the following command:

$ sudo apt-get install htop

htop should be installed.

Now run the following command to start htop:

$ htop

This is the main window of htop.

Basics of htop

Now I am going to talk about the interface of htop program.

On the marked section in the screenshot below, you can see the uptime of your computer. As you can see, my computer is running for 2 hours 41 minutes and 58 seconds.

You can find how much of the CPU is used in the marked section in the screenshot below. As you can see I have 2 cores in my processor and only 0.7% out of 100% of each is used.

In the marked section in the screenshot below, you can find how much main memory or RAM is available and how much is used. You can also find out how much Swap space is available and how much of it is used.

As you can see, I have 2.91 GB or RAM available and 1.67 GB is used. I also have 947 MB of swap space available and 0 KB is used. Note that, the more swap is used, the more you should be worried. If more swap is used, you should upgrade your main memory or RAM.

Search for Process

You can search for a specific process with htop. For example, let’s say you want to search for the process ‘firefox’.

First start htop and press <F3>. A search box should appear as shown in the screenshot below.

Now type in ‘firefox’, and you should see firefox process selected as shown in the screenshot below. You can see that the process id (PID) is 2240 and the process is owned by USER shovon.

To go to the next firefox process or search result, press <F3> again.

Once you find the process you’re looking for, press <Enter> to select it.

Kill a Process

You can also kill a process with htop utility.

First select a process using the <Up> and <Down> arrow keys or by searching for a process using <F3>.

Let’s say PID 2240 is the process I want to kill. I selected the process as you can see in the screenshot below.

Now to kill the process, press <F9>. You should see the following window as shown in the screenshot below. In the marked section, there are different Linux signals listed. These signals are used to manage Linux processes. To kill a process, the default signal for htop is SIGTERM. You can of course choose any other signals using the <Up> and <Down> arrow keys.

Once you select the signal you want to send to the process, press <Enter>. I suggest you send the default signal SIGTERM if you don’t know what to do here.

The process should be killed as shown in the screenshot below.

Switching to Tree View

The default view mode of htop is Sorted.

You can switch to Tree view if you want by pressing <F5> as shown in the screenshot below.

You can go back to Sorted view again by pressing <F5>.

Customizing htop Window

You can press <F2> to go to htop configuration window as you can see from the screenshot below.

From here you can customize the main window of htop. For example, you can hide or show things, change colors and many more. It is out of the scope of this article. But it should be easy enough to figure out on your own.

Once you’re done, you can exit out of htop window using the ‘q’ key.

That’s how you install and use htop on Ubuntu 17.10 Artful Aardvark. Thanks for reading this article.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

How to Lock Screen on Ubuntu

The lock screen is an essential security feature of any operating system. Ubuntu is a Linux distro and that also puts a...
29/12/2020

Ubuntu for Android is Dead

The developer community has always had a thing for open source software. This is precisely why Ubuntu became so famous all...
12/02/2020

Upgrade Ubuntu 18.04 LTS to 18.10

The Ubuntu 18.10 Cosmic Cuttlefish will be released on October 18, 2018. If you can’t wait to see what Ubuntu 18.10 has...
29/12/2020
Bài Viết

Bài Viết Mới Cập Nhật

Mua proxy v4 chạy socks5 để chơi game an toàn, tốc độ cao ở đâu?
18/05/2024

Thuê mua proxy Telegram trọn gói, tốc độ cao, giá siêu hời
18/05/2024

Thuê mua proxy Viettel ở đâu uy tín, chất lượng và giá tốt? 
14/05/2024

Dịch vụ thuê mua proxy US UK uy tín, chất lượng số #1
13/05/2024

Thuê mua proxy Việt Nam: Báo giá & các thông tin MỚI NHẤT
13/05/2024