Hi everyone. Has your Linux computer ever slowed down out of nowhere, with the fan spinning up even though you barely had anything open? Most of the time one program is quietly eating your CPU or memory. On Windows you would open Task Manager to find it. On Linux, the terminal gives you two tools that do the same job: top and htop.
In this guide I start a program that keeps the CPU busy on purpose, then we track it down together and stop it. I am using Ubuntu 26.04, but everything here works the same on Debian, Linux Mint, and most other distros.
Distro : Ubuntu 26.04.1 LTS (Desktop)
Tools : top (built in) and htop 3.4.1Getting to Know top
top comes preinstalled on almost every Linux system. That makes it the tool to reach for when you are on a fresh install or someone else’s server and cannot install anything.
The screen looks busy at first, full of numbers. You do not need to understand all of them. A few key parts are enough, and I will point them out below.
Open top

Before opening top, I ran yes > /dev/null & in the terminal. This command does nothing useful. It just prints the letter y forever, which makes it a perfect troublemaker for practice. Then type:
topThe top section (number 1) is a quick health check of your computer. The %Cpu line shows how busy the processor is, and the MiB Mem line shows how much RAM is in use. Below that is the list of running programs, which Linux calls processes. You can see yes sitting at the top with 100 in the %CPU column (number 2). That is our culprit.
Note: 100 percent here means the program is using one full CPU core. My machine has 6 cores, so the total can go up to 600 percent.
Sort by memory instead

By default top puts the heaviest CPU users first. If you suspect memory is the problem, press a capital M (Shift + M) while top is open. Now %MEM decides the order (number 1), and the biggest memory users move to the top. On my computer that was gnome-shell (number 2), the Ubuntu desktop itself, so nothing unusual there. Press a capital P to go back to sorting by CPU, and q to quit.
Using htop for a Friendlier View
If top feels a bit old-school, htop is the friendlier version. It uses colors, draws a bar for each CPU core, and lets you use the F1 to F10 keys instead of remembering single-letter shortcuts.
htop is not always installed by default. If you get command not found, install it first with sudo apt install htop. I already had it from the earlier guide on installing packages with apt.
Open htop

htopThe numbered rows 0 to 5 at the top (number 1) are your CPU cores. The longer the bar, the busier that core is. Mem and Swp below them (number 2) show RAM and swap usage. Swap is space on your disk that Linux uses as backup memory when RAM runs out. If Swp starts filling up, your computer will usually feel sluggish.
Load average (number 3) shows three numbers: how busy the system has been over the last 1, 5, and 15 minutes. A simple rule of thumb is that as long as these stay below your number of CPU cores, your system is doing fine. The bottom row (number 4) lists the keys you can use.
Find a process with F4

The process list can get very long. To find one program, press F4 and type its name. I typed yes. Now the list only shows yes (number 2), with a high CPU%. Core 1 is also maxed out at 100 percent in red (number 1), which tells you that is the core yes is using. The Filter box at the bottom (number 3) shows what you searched for. Press Enter to keep the filter.
Stopping the Program That Slows You Down
Once you have found the troublemaker, you can stop it right inside htop, no need to quit and type another command. Select the process and press F9.
Just make sure you picked the right one. You do not want to stop a system program or something with unsaved work by mistake.
Press F9 and pick a signal

With yes still selected, press F9. A Send signal menu opens on the left. A signal is simply a message you send to a program. The highlighted default is 15 SIGTERM (number 1). It politely asks the program to close and gives it time to clean up. Press Enter to send it.
If the program refuses to stop, press F9 again and choose 9 SIGKILL (number 2). This forces it to quit immediately, so use it only when the polite option does not work. I explain these signals in more detail in the guide on how to kill a process in Linux.
Make sure it is gone

After quitting htop with q, I double-checked from the terminal.
pgrep -a yes; echo exit code $?pgrep printed nothing except exit code 1 (number 1), which means yes is no longer running. The CPU is back to idle.
Common Problems and How to Fix Them
Most issues with top and htop are small ones, usually the tool is not installed or you are not sure how to get out. Here are the ones I see most often.
If you run into something else, copy the full error message. It makes the fix much easier to find.
htop: command not found
htop is not installed yet. Run sudo apt install htop and try again.
I cannot exit top or htop
Press q. In htop, F10 works too.
Operation not permitted when stopping a process
The program belongs to another user or to the system (root). Quit, then open it with sudo htop. Only do this if you know exactly what you are stopping, because killing a system process can cause problems.
The program comes back after I stop it
It is probably a service that is set to restart on its own. Stop it properly with systemctl, which I cover in the guide on managing services with systemctl.
That is how you find and stop the program slowing your Linux computer down. Use top when you need something quick that is always available, and htop when you want a clearer, easier view. If the computer is slow but CPU and RAM look fine, also check whether the disk is full with the df and du commands. If you hit a problem or a message I did not cover, let me know in the comments.












