htop is an interactive version of top command which we use to get the process listing. top command is quite popular and most of the users run this command to get the running process details and their impact on system performance. This command is quite useful in order to know the process which is consuming excess CPU or memory. In this blog I will cover htop tool which provides an interactive and more intuitive view of traditional top command. It is a system monitoring tool which we can run from the terminal after installing it on the machine. So lets start this by installing the htop tool.
Before installing the htop tool we need to update the apt repository on Ubuntu:
sudo apt-get update
After updating the Ubuntu apt repository we can install htop by executing following command:
sudo apt-get install htop
After successful installation of htop we can execute htop by executing following command:
This will open following screen:
In the above screen-shot we can see two sections. On left side of the top section, we can see the CPU usage and memory usage. On the right side we can see total tasks, load average and uptime etc. Below this we have the tabular data display where we can see process id, user, cpu, memory usage and actual command which was executed. On the bottom we have shortcuts using which we can perform various tasks like search, filter, sort, kill etc.
We can kill any process by moving the cursor on the process using up and down arrow. Once the cursor reaches on the process we can click on 'F9' key. This will ask for confirmation where we can press on enter button to kill the process or can press on esc button to cancel the kill process. Below screen-shot displays the confirmation option which appears on bottom:
We can kill the process by hitting enter button.
This is a nice tool which gives us a clean colorful view using which we can easily understand what is happening. In top command we have no option to kill the process unless we pass the process id to the kill command but in htop we can do lot of things from a single screen, also the shortcuts are quite handy and increases the productivity. In case of any suggestion or query please do comment.
Leave a comment
Sep 23, 2020, 2:38:00 PM | Anurag Srivastava
Sep 6, 2020, 5:20:33 PM | Anurag Srivastava
Jan 16, 2020, 11:43:29 AM | Anurag Srivastava
Jan 14, 2020, 10:22:34 AM | Anurag Srivastava
Jan 7, 2020, 7:15:34 PM | Anurag Srivastava
Jan 6, 2020, 7:30:13 PM | Anurag Srivastava
Jun 21, 2018, 4:58:11 AM | Anurag Srivastava
Jul 16, 2018, 5:00:02 PM | Anurag Srivastava
Mar 9, 2019, 8:20:38 AM | Anurag Srivastava
Feb 9, 2019, 12:06:18 PM | Anurag Srivastava
Jun 13, 2018, 3:44:01 PM | Anurag Srivastava
Jun 26, 2018, 4:50:18 PM | Anurag Srivastava