Linux Process management tool (ii): Htop

Source: Internet
Author: User

Lab Environment:

CentOS Release 6.6 (Final) One

IP Address: 172.16.249.230


Htop is a Linux system monitoring and process management software, used to replace the UNIX under the traditional top. Unlike top, which provides only the most resource-consuming list of processes, Htop provides a list of all processes and uses color to identify processor, swap, and memory states.

Users can typically choose to install and use Htop when top does not provide detailed system information. For example, when looking for an application's memory leak problem. Compared to top, Htop provides a more convenient, cursor-controlled interface to kill processes.

Htop was written in C language and adopted the ncurses library. The name of Htop originates from the name of its author.

FreeBSD can run Htop

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/54/04/wKioL1R1uSWSnqv0AAWAHeRrmN4829.jpg "title=" 1.png " alt= "Wkiol1r1uswsnqv0aawaherrmn4829.jpg"/>


A Htop Introduction

Htop is more user-friendly than the traditional Linux top. It allows users to interact interactively, support color themes, scroll through the list of processes horizontally or vertically, and support mouse actions.

Compared to top, Htop has the following advantages:

You can scroll through the list of processes horizontally or vertically to see all the processes and the complete command line. On startup, it's faster than top. Process number is not required to kill the process. Htop supports mouse operation. Top is already very old.


Two Htop Installation

It can be installed through Yum install Htop, but only if you want to add Epel's Yum source, refer to the Linux Process Management tool (C): Glances.

# yum install htop[[email protected] ~]# yuminstall htoploaded Plugins:fastestmirror,refresh-packagekit, Securitysetting up Install processloading mirror speeds fromcached hostfilepackagehtop-1.0.1-2.el6.x86_64 already Installed and latest versionnothing to do


Three, htop parameters

Type the htop command to open htop.

# Htop

Above the upper left corner shows the CPU, memory, swap area usage, the right display task, load, boot time, the following is the process real-time status.

The following is the function of F1~F10 and the corresponding letter shortcut keys.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/54/05/wKioL1R1vH_yaS9eAAFCiMK4S-o859.jpg "title=" Htop1.jpg "alt=" Wkiol1r1vh_yas9eaafcimk4s-o859.jpg "/>


Command-line option (Command-Line options)

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/54/05/wKioL1R1vI-zs3J3AAENYkZy9mc025.jpg "title=" Htop2.jpg "alt=" Wkiol1r1vi-zs3j3aaenykzy9mc025.jpg "/>


Interactive commands (INTERACTIVE COMMANDS)

Up or down key or PgUp, PgDn Select the desired process, the left or right key or home, End Mobile field, of course, can also be directly selected process with the mouse;

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/54/06/wKiom1R1vF6R_0h6AALXcAVkRWk045.jpg "title=" Htop3.jpg "alt=" Wkiom1r1vf6r_0h6aalxcavkrwk045.jpg "/>


Iv. Use of Htop

1. Show your own Help

Mouse click Help or press F1 to show your own

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/54/06/wKiom1R1uMShHhTJAAJGIzggurQ132.jpg "title=" 2.png " alt= "Wkiom1r1umshhhtjaajgizggurq132.jpg"/>


2. Htop Settings

Mouse click Setup or press F2 after entering the Htop set page, meters page set the top of some information display, the top of the display is divided into the left and right sides, in the end can show what can be in the rightmost (availablemeters) that column added, To add to the upper left (F5) or to the right (F6), this is the range of personal settings. The host name hostname is added here.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/54/04/wKioL1R1uZzgDhamAAFby-3iSjA403.jpg "title=" 3.png " alt= "Wkiol1r1uzzgdhamaafby-3isja403.jpg"/>



Above the left and right two columns of the display mode is divided into text bargraph Led Four, I will change the CPU to text mode display, and then to change the memory to bar display, clock with Led mode display. The data show is similar, just look a bit unaccustomed.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/54/06/wKiom1R1uTfRMXzFAAFsOwhA8oU442.jpg "title=" 4.png " alt= "Wkiom1r1utfrmxzfaafsowha8ou442.jpg"/>



The settings for display options can be set according to the manager's own needs.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/54/04/wKioL1R1udXgxcsVAAF_G4ClwFI327.jpg "title=" 5.png " alt= "Wkiol1r1udxgxcsvaaf_g4clwfi327.jpg"/>



Color selection, in addition to the basic color display, Htop also provides the function of changing the panel, in fact, just change some color display settings, although said can not be customized to the details of the color display, but at least provide several styles can be selected. I tried some black ones!

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/54/06/wKiom1R1uWXyIhoqAADmftUFu8s376.jpg "title=" 6.png " alt= "Wkiom1r1uwxyihoqaadmftufu8s376.jpg"/>


The last item is to adjust the display of the Columns, that is, in the general htop instructions in order to see what kind of data and information, the adjustment of the field can be done on this side of the personalized settings, generally use the system default value is good.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/54/04/wKioL1R1ufPSZGWTAAFdwOFbYqc598.jpg "title=" 7.png " alt= "Wkiol1r1ufpszgwtaafdwofbyqc598.jpg"/>



3. Search process

Mouse click Search or press F3 or enter "/", enter the process name to search, such as search: Nginx

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/54/06/wKiom1R1uX_i_kwmAAOPTYMwtBA710.jpg "title=" 8.png " alt= "Wkiom1r1ux_i_kwmaaoptymwtba710.jpg"/>


4. Filter

Press F4, enter filter, equivalent to keyword search, not case-sensitive, such as filter sbin

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/54/06/wKiom1R1uY7QxWs7AAO36d8N1rs078.jpg "title=" 9.png " alt= "Wkiom1r1uy7qxws7aao36d8n1rs078.jpg"/>


5. Show tree structure

Enter "T" or press F5, show the tree structure, meaning with pstree almost, can see all the program tree execution structure, which is very convenient for system management, how to clarify the procedure is generated, of course, the tree structure of the browsing can also be sorted according to other data.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/54/06/wKiom1R1uZ6CeHNKAAQiLFuv37M414.jpg "title=" 10.png "alt=" Wkiom1r1uz6cehnkaaqilfuv37m414.jpg "/>


6. Select the Sort method

Press F6 to choose what to sort by, the most commonly ordered content is CPU and memory bar!

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/54/06/wKiom1R1ubHRWprZAAPa57X2rFY238.jpg "title=" 11.png "alt=" Wkiom1r1ubhrwprzaapa57x2rfy238.jpg "/>


7 Operation Process

F7, F8 respectively corresponds to nice-and nice+,f9 corresponding kill to process signal, choose good signal return is OK, here send kill signal 9 to Htop is to close htop.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/54/04/wKioL1R1ukPQuNr6AAQ2ECp9Dis511.jpg "title=" 12.png "alt=" Wkiol1r1ukpqunr6aaq2ecp9dis511.jpg "/>


Five, Alias top

Perhaps you are used to top, we can also use top to open the htop.

Edit the/ROOT/.BASHRC file and add the following code

if [-f/usr/local/bin/htop]; Then alias top= '/usr/local/bin/htop ' fi# SOURCE/ROOT/.BASHRC


Htop end of the introduction, the next article is the end of this article: Linux Process management Tools (iii): Glances use!


This article is from "Dragon Guardian" blog, please make sure to keep this source http://sohudrgon.blog.51cto.com/3088108/1583047

Linux Process management tool (ii): Htop

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.