How-To Geek
Using htop to Monitor System Processes on Linux
Most people familiar with Linux have used the top command line utility to see what process is taking the most CPU or memory. There’s a similar utility called htop that is much easier to use for normal tasks.
The first great thing about htop is that it will show you your usage per CPU, as well as a meaningful text graph of your memory and swap usage right at the top. I find this much easier to understand at a glance than the default output from top.
Installing htop on Ubuntu
Installing on Ubuntu is as simple as apt-get… You can also grab the source from the htop site linked at the bottom of this article.
sudo apt-get install htop
Once installed, just type htop at a terminal to launch it, and notice the great text-mode graph at the top of the display:

But here’s the best part… just use your Up/Down arrow keys to select a process, and then you can kill it with the F9 key if you’d like, or you can change the priority by using the F7 and F8 keys. (note that you’ll have to be root to give anything really high priority).

You can also use the F6 key to change the default sort column really easily:

You can check the setup options for a lot more settings like which columns should show up by default.
Got Feedback? Join the discussion at discuss.howtogeek.com
Comments (15)
Programmer by day, geek by night, The Geek, also known as Lowell Heddings, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on Google+ if you'd like.
- Published 07/10/07




Mmmhmm, looks nice.. now to port it to freebsd.
What KDE theme are you using in those screenshots?
It’s the default one that comes with Kubuntu, actually… it’s called Crystal
I’m pretty sure it will compile fine on FreeBSD….
I am sure you missed the word “Install” out of the Ubuntu command to install Htop.
Think it should be…
sudo apt-get install htop
;o) All the best!
FrankX
FrankX,
Thanks for noticing that! That’s gotta be the 10th time I’ve forgotten the word install when typing apt-get. =)
Yes, this should work.
I’ll be installing ‘htop’ when I get home.
Incidentally, I was impressed that you said ‘really easily’.
I get nostalgic about the correct (ie, old-fashioned) use of English.
Let me guess – you’re not ‘uhmerkin’.
Thank you, thank you! For me, the reason to try htop (and now, to use it) was that it lets you SCROLL. I always find it frustrating to have 20 identical things at the top of the list sorted by memory, when it’s really 20 threads sharing that large amount of memory (firefox…).
this is terrific, the standard system monitor in ubu takes up a s^%t load of cpu so this should help a lot- realily easily-ly : )
‘htop’ is much better than ‘top’ in my opinion. I like the ability to kill a process without typing in the process number, and it supports mouse operation
Oh man, that’s a sweet little piece of software. Much nicer took at than Top, and more accurate than the standard Ubuntu System Monitor application.
Karl A. Krogmann
When you guys say:
Just “apt-get install” of, say, “htop”
this would presumably work _if_ the sources.list had the right
repositories listed in it.
I’ve gotten my new VPS up doing web, email and spam, well enough
that it works for me, but I have no idea what other repositories
“should” be in sources.list.
My sources.list only contains:
archive.ubuntu.com lines for lucid, lucid-updates, and lucid-security
what else does everybody assume is available?
Any plans to right a follow up article on what this should be used for? or basic insight into how it can be used productively?
All I did was type in htop in the terminal and instructions followed automatically.