Tip: Changing top to htop
I’d like to share with you a great tool I’ve been using for some time. All of you Linux users know the top tool which allows you to view running tasks, monitor system load, memory consumption, swap, etc… The look & feel of top is old and plain which for this purpose is usually what you need, but check out ‘htop’.
The built-in top tool:
Here’s the manual for top: https://linux.die.net/man/1/top
The recommended htop tool:
You can see in the lower bottom of the screen a list of options assigned to the F keys which in my opinion is much more comfortable to work with.
So, let’s see how to install htop:
First, you’ll have to install rpmforge repository, you can do so by following my earlier post: How to: Install RPMFORGE repository in RHEL/CentOS.
Now, let’s let’s install:
# yum install htop
When download and installation finish htop is installed but since I know how hard it is to change old habits kindly go over the following and save yourself future headaches:
replace htop with top using an Alias:
There are two ways to do this, the temporary way and the permanent way:
- The temporary way:
# alias top=”/usr/bin/htop”
It will work only in your current session but upon log out the alias will be deleted.
- The permanent way:
# echo ‘alias top=”/usr/bin/htop”‘ >> /etc/bashrc
This will input the alias line into the /etc/bashrc file, which is meant for alias and system wide variables. Now, all you have to do is run htop by typing just: top
If you’re using Ubuntu :
$ sudo apt-get install htop
And add it to ~/.bashrc rather than to /etc/bashrc . I hope you liked my guide, feel free to leave comments!