How to Check CPU Usage in Ubuntu

Photo of author

By Oluwaseun Bamisile

Published

Do you want to check the CPU usage of your Ubuntu Linux-based computer? Go through this detailed guide, as it illustrates various ways to achieve that.

Before we proceed, it is important to note that the steps featured in this article are based on the Ubuntu 22.04 LTS OS. Hence, the steps might differ slightly on other versions of the Ubuntu Linux-based OS.

Option 1: Show Processor Usage via System Monitor

The Ubuntu Linux-based operating system comes with a System Monitor program that analyses resources and apps on your computer. Thus, through the System Monitor program, you can check the processor usage of your Ubuntu PC.

The following procedures listed below will demonstrate how to do that.

  1. Open the app menu in Ubuntu by clicking the Show Applications button on the Ubuntu dock. Then, type “system monitor” in the search field and select the System Monitor program for the search result.
  1. Following that, switch to the Resources tab on the System Monitor program.
Show Processor Usage In Ubuntu Via System Monitor
  1. On the Resources page, you will see live usage info of your computer’s CPU.

Option 2: View CPU Usage Through the Terminal

Another way to check the processor usage of your Ubuntu Linux-based computer is through the terminal. In fact, there are a couple of commands that allow you to check the CPU usage through the Ubuntu terminal.

However, we will focus on three of those commands in this section. These commands include the top command, htop command, and iostat command.

So, the following sub-sections will demonstrate how to use those commands to view the CPU usage in Ubuntu.

Check CPU Usage Using the Top Command

The top command is a handy command-line tool that monitors all running processes on your Ubuntu computer in real-time. It also displays information about the readout of users, CPU usage, and memory usage in real-time.

Moreover, the top command updates the data every 5 seconds by default. That being said, the subsequent procedures will demonstrate how to see the CPU usage of your Ubuntu PC using the top command.

  1. Right-click any free spot on your Ubuntu desktop, then pick Open in Terminal from the context menu. Alternatively, press the Ctrl + Alt + T keys simultaneously to open the terminal in Ubuntu.
  1. Afterward, input the command below in the Ubuntu terminal and press the enter key on your keyboard.
top
View CPU Usage In Ubuntu Through The Terminal
  1. Consequently, the command will display the resource usage of your Ubuntu computer, including the CPU usage, in real time. The percentage of CPU usage should be displayed in the “%CPU” column.
To exit the top command, press the “q” key on your keyboard.

Show CPU Usage Using the Htop Command

The htop command is another command-line tool that allows you to view and manage system processes. Basically, the command-line tool displays a list of running processes and the number of CPU resources they are using in real-time.

Similar to the top command discussed above, this command refreshes data every couple of seconds. That being said, follow the steps below to learn how to show the CPU usage in Ubuntu using the htop command.

  1. Click the Show Applications button on the Ubuntu dock to open the application menu. Then, input “terminal” in the search field and select the Terminal program from the search result.
Alternatively, use the Ctrl + Alt + T keyboard shortcut to open the terminal in Ubuntu.
View CPU Usage In Ubuntu Through The Terminal
  1. Now, run the command below to install the command-line tool. However, before the command executes, you will be prompted to input your password – do so and press the enter key.
sudo snap install htop
You should know that when typing your password in the Ubuntu terminal, characters won’t be visible.
  1. Consequently, the htop command-line tool should begin to install.
View CPU Usage In Ubuntu Through The Terminal
  1. After the command-line tool has been installed, execute the command below to display the CPU usage. Thus, you should see the percentage of CPU usage in the “CPU%” column – see the second screenshot below.
htop
You can exit the htop command-line environment by pressing “q” on your keyboard.
View CPU Usage In Ubuntu Through The Terminal

Discover CPU Usage Using the Iostat Command

The last command we will discuss in this section is the iostat command. This command is part of the sysstat package that enables users to monitor system performance in Ubuntu, including CPU usage.

Thus, the following steps and screenshot images will demonstrate how to use the command to view the CPU usage in Ubuntu.

  1. Launch the terminal in Ubuntu by right-clicking any free area on the Ubuntu desktop and selecting Open in Terminal from the context menu.
  1. When the terminal opens, type the subsequent command and press the enter key to install the sysstat package. However, before the installation begins, you will be prompted to input your computer’s password – do that and press the enter key.
sudo apt install sysstat
You should know that characters won’t be visible when typing the password in the Ubuntu terminal.
View CPU Usage In Ubuntu Through The Terminal
  1. Subsequently, the sysstat package should begin to install.
  1. After installing the sysstat package, execute the command below to see the CPU usage on your Ubuntu computer. Thus, you should see the average usage of your computer’s CPU since the last boot.
iostat
View CPU Usage In Ubuntu Through The Terminal

Frequently Asked Questions

1. What is the full meaning of CPU?

The full meaning of CPU is Central Processing Unit.

2. How do I check the CPU usage in Ubuntu?

To check the processor usage in Ubuntu through the system monitor, follow the steps below.
a) Open the app menu in Ubuntu by clicking the Show Applications button on the Ubuntu dock.
b) Then, type “system monitor” in the search field and select the System Monitor program for the search result.
c) Following that, switch to the Resources tab on the System Monitor program.
d) On the Resources page, you will see a live usage of your computer’s CPU.

3) What is the command to display processor usage in Linux?

You can use the “top” command to display the processor usage in the Linux operating system.

4. What does CPU usage mean?

The amount of work a CPU puts in to complete the given tasks or process is known as CPU usage. A computer’s performance might be negatively affected by high CPU usage, so monitoring this metric is important.

5. What are the effects of high CPU usage In Ubuntu?

Some of the effects of high CPU usage in Ubuntu include longer loading times, sluggish performance, and unexpected crashes.

Conclusion

CPU usage is an important metric to monitor in any operating system, including the Ubuntu OS. Knowing how much CPU is being used by your computer and individual processes can help you identify performance bottlenecks.

It can also help you troubleshoot issues and optimize system performance. Fortunately, this guide discussed multiple methods to know the CPU usage on your Ubuntu Linux-based computer.

To be specific, we learned how to accomplish the task through the System Monitor program in the Ubuntu GUI. This guide also taught us how to check the CPU usage in Ubuntu with three different commands in the terminal.

Hopefully, you enjoyed reading this guide and found it helpful. If you did, click on “Yes” beside the “Was this page helpful” question below.

You may also express your thoughts and opinions by using the “Leave a Reply” form at the bottom of this page.

Finally, you can visit our Linux how-to page to find other helpful Linux how-to guides.

About the Author

Photo of author

Oluwaseun Bamisile

Oluwaseun is the Lead Content Editor at Itechguides.com. He holds a National Diploma in Computer Science (currently studying part-time for his Higher National Diploma). An internet geek with a love for automobiles, he writes product reviews, tech articles, and how-to guides on the site.

Related Articles

Get in Touch

We're committed to writing accurate content that informs and educates. To learn more, read our Content Writing Policy, Content Review Policy, Anti-plagiarism Policy, and About Us.

However, if this content does not meet your expectations, kindly reach out to us through one of the following means:

  1. Respond to "Was this page helpful?" above
  2. Leave a comment with the "Leave a Comment" form below
  3. Email us at [email protected] or via the Contact Us page.

Leave a comment