The use of Htop tools for Linux system process management

Source: Internet
Author: User

There are many tools on Linux for system process management, such as PS, Pstree, pidof, pgrep and so on, but they all just capture the process state information of the previous second that the current administrator entered the command and hit enter, and it will not be highlighted, so Htop appears.

Htop is the enhanced version of top, highlighting process information is added. Although top can dynamically get and return process information to the terminal but because all process state color is the same inconvenient observation, recommended to use Htop, glances, Dstat and other management tools, if you can write a dedicated it is another matter.

The next step is to introduce the use of the Htop tool (glances, Dstat will be described in a later article. )

The CENTOS6 series appears to be the default without the installation package with Htop, its official website address is: http://hisham.hm/htop/, the official supply of the source package and applicable to a variety of mainstream Linux binary package.

Binary package (only for Rhel or CentOS versions): http://pkgs.repoforge.org/htop/, source package: http://hisham.hm/htop/releases/These two URLs are officially provided, Contains the binaries and source code for all versions of Htop.

Htop use is the GPL agreement, so if the htop on the basis of rewriting the words must be open source, remember to remember.


OK, let's get back to the chase. Let's take a look at the interface of Htop (my centos forgot to put it in the demo directly under My Computer). )

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/54/6A/wKiom1SBZCfiVV5gAASo8hBz5Tg245.jpg "title=" Bandicam 2014-12-05 15-51-47-913.jpg "alt=" Wkiom1sbzcfivv5gaaso8hbz5tg245.jpg "/>

Explain it:

From top to bottom, there are three sections in the upper-left corner where the CPU, memory, and swap partition usage is displayed (I was swapping the partition when I was pretending to be Ubuntu. And then I deleted it and it doesn't show the swap partition)

The upper-right corner shows the current system tasks and threads, and the second line shows the CPU's load-balancing at 1 minutes, 5 minutes, 15 minutes of course the lower the better, the third row is the refresh time (that is, refresh the current system state, the default is 2 seconds).

The rest shows the PID of the process, the user who started the process, priority, nice value, virtual memory usage, resident memory, shared memory, process state, CPU consumption, memory footprint, enable time, command (referred to above as left-to-right), and other information

Next is how to use, very simple we open the terminal input Htop can enter. Then we open htop need to look at the daemon user enabled process, we can not one by one press up and down key to go over after all that is too tired, right? There is a better way to press the "U" key (note is not uppercase u but lowercase), press u later on the left will show the START process all the users at this time we can press the up and down button to select the user to view, and then press ENTER will display the user initiated process information of your choice. (see) 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/54/6A/wKiom1SBaEzj5echAAQgbnlECLY103.jpg "title=" Bandicam 2014-12-05 16-09-35-215.jpg "alt=" Wkiom1sbaezj5echaaqgbnlecly103.jpg "/>

The above figure is to let you see the effect of pressing the U key, then to see the details of the process initiated by the Daemon user 650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M00/54/68/ Wkiol1sbazhcmledaaqdvglwe9q293.jpg "title=" Bandicam 2014-12-05 16-11-52-615.jpg "alt=" Wkiol1sbazhcmledaaqdvglwe9q293.jpg "/>


If we want to continue to view all the process information then press the U key, the first one is all users (on behalf of all user) and then hit enter to go back to the interface that just started Htop (not shown here, after all, a simple operation)

If we just want to see the longest running process, we can press the upper case T, and of course we'll go back to the start screen by pressing the lowercase t. 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/54/6A/wKiom1SBaemRr843AATKdVKRGtg529.jpg "title=" Bandicam 2014-12-05 16-16-31-309.jpg "alt=" Wkiom1sbaemrr843aatkdvkrgtg529.jpg "/>

If we look at a process with high CPU consumption, we can press uppercase p to return or lowercase t, of course, the memory information is the same (similar do not do the demo, forgive me.) )

We press F5 to display information about the process tree (after all, any process that has its parent process can run) returns as well as pressing F5.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/54/6A/wKiom1SBazixTMsNAAWpHJOYL3Q036.jpg "title=" Bandicam 2014-12-05 16-21-29-009.jpg "alt=" Wkiom1sbazixtmsnaawphjoyl3q036.jpg "/>

If you feel the above information such as CPU memory display style you do not like it can be adjusted, press F2 to adjust their status (F10 completion or ESC exit the current setting)

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/54/68/wKioL1SBbFCzLRwXAAKXjulDcZk178.jpg "title=" Bandicam 2014-12-05 16-24-24-009.jpg "alt=" Wkiol1sbbfczlrwxaakxjuldczk178.jpg "/>

or from left to right.

The first line on the left can change the appearance of the top, and the second I'm not used to the explanation, the third one is to change the display color, and the fourth to change the field of the intermediate process.

Here to see the fourth option, the first and third in front of the use of special convenience not to do a demonstration, the second I also did not use to do the demo (forgive me. ) 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/54/6A/wKiom1SBbM2yaQhwAAKY0xTqPLA236.jpg "title=" Bandicam 2014-12-05 16-28-53-314.jpg "alt=" Wkiom1sbbm2yaqhwaaky0xtqpla236.jpg "/>

In the middle of the content is the active field is our default open htop display option to the right side is the support display of the field, if you want to add options can use the arrow keys right into the right to enter to add success, remove the words by the arrow key left to enter the active field F9 can be removed, If you want to put the user this field in front of the PID, then move the cursor to the PID of the line to press F8 just fine. or move the cursor to the user field by pressing F7. 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/54/69/wKioL1SBbm2jHLrYAAKbFEXca1Y173.jpg "title=" Bandicam 2014-12-05 16-33-24-511.jpg "alt=" Wkiol1sbbm2jhlryaakbfexca1y173.jpg "/>

This will show a different order when we press the F10 or ESC key. 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/54/6A/wKiom1SBbijTMSuHAAT3HNySAFo680.jpg "title=" Bandicam 2014-12-05 16-34-19-405.jpg "alt=" Wkiom1sbbijtmsuhaat3hnysafo680.jpg "/>

If we want to search for information about a process, press F3 and enter what you want to find, and if the process has more than one child process, press F3 to jump to the matching content. 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/54/69/wKioL1SBb0yACmguAATMRk9FZJ0737.jpg "title=" Bandicam 2014-12-05 16-37-05-710.jpg "alt=" Wkiol1sbb0yacmguaatmrk9fzj0737.jpg "/>

Get help information press F1 or H key to 650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M02/54/6A/ Wkiom1sbbymgndm-aasj28es6oi575.jpg "title=" Bandicam 2014-12-05 16-38-22-014.jpg "alt=" Wkiom1sbbymgndm-aasj28es6oi575.jpg "/>

There's a lot of stuff here that doesn't explain--. After all, it's too long, and I don't like to read a lengthy article that says it's a lot of nonsense.

The last one has just got a new skill (that is, when you write this blog, you accidentally press the wrong and then you find it.) )

We htop the interface press "," is the keyboard letter to the right of the comma key can be specified in the current active field of a field to display the process information

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/54/69/wKioL1SBcFmS9h4mAARkvUFFx5U364.jpg "title=" Bandicam 2014-12-05 16-41-36-612.jpg "alt=" Wkiol1sbcfms9h4maarkvuffx5u364.jpg "/>


There is Wood has a feeling very strong, is simply artifact has wood, be sure to remember how to get the package. Later posts will also cover the use of glances and dstat. These are very power-giving system process management tools.


This article is from the "Yxn" blog, make sure to keep this source http://jyxnt.blog.51cto.com/9581167/1586708

The use of Htop tools for Linux system process management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.