Htop-Powerful Process management tools

Source: Internet
Author: User

Directory:

A. Htop command introduction.

Two. Features of the Htop tool.

Three. Source code compile and install Htop.

Four. The options for the Htop command are detailed.

Five. Htop command operation example.

Six. Htop command-line options.

Seven. Alias top.


A. Htop Command introduction:

Htop-interactive Process Viewer, It is similar to top, but allows you to scroll vertically and horizontally, so can See all the processes running in the system, along with their full command lines, as well as viewing them as a process Tre E, selecting multiple processes and acting on them all at once. "From Htop Man Handbook"

Translate as follows:

Htop-Interactive Process Viewer, which is similar to top, allows you to view processes vertically and horizontally, so you can see all the processes running on the system, including the full command line when running these processes, and viewing the process tree, selecting multiple processes and manipulating them accordingly.

Two. Features of the Htop tool.

Htop provides a list of all processes, and uses color to identify the processor, swap, and memory states. Users can typically choose to install and use Htop when the top command is unable to provide detailed system information. Compared to top, the htop is more user-friendly and provides a more convenient way to kill a process with a cursor-controlled interface!

Three. Source code compile and install Htop.

SOURCE Bundle: http://hisham.hm/htop/releases/

[Email protected] tools]# cat/etc/redhat-release CentOS Linux release 7.1.1503 (Core) [[email protected] tools]# wget HT Tp://hisham.hm/htop/releases/2.0.2/htop-2.0.2.tar.gz[[email protected] tools]# tar zxf htop-2.0.2.tar.gz [email Protected] tools]# CD Htop-2.0.2/[[email protected] htop-2.0.2]#./configure--prefix=/usr/local/htop-2.0.2

Note: Here may be an error, the error message is as follows:

Configure:error:You may want to use--disable-unicode or install LIBNCURSESW.

The error message prompts you to install LIBNCURSESW.

Workaround: Install the ncurses package!

Ncurses Package: Provides a character terminal processing library, including panels and menus.

To install the ncurses package:

[Email protected] htop-2.0.2]# yum-y install ncurses ncurses-devel

Then perform the previous step of the./configure command should be no problem!

Finally execute make && make install:

[[email protected] htop-2.0.2]# make && make install
[Email protected] htop-2.0.2]# echo $?0

In order for the Htop command to be recognized successfully, you also need to add the absolute path to the htop command in the path path:

[Email protected] htop-2.0.2]# cd/usr/local/htop-2.0.2/bin/[[email protected] bin]# lltotal 728-rwxr-xr-x. 1 root root 742555 Jan 15:59 htop[[email protected] bin]# pwd/usr/local/htop-2.0.2/bin//Add the absolute path to the path; [Email protected] bin]#
[Email protected] bin]# vim/etc/profile ... Path=/usr/local/htop-2.0.2/bin: $PATH//end to add the line and save exit!
[Email protected] bin]# Source/etc/profile

Then run htop at the command line to see:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/8D/17/wKiom1iFu2OhFNeXAAMXXgO8DaI278.png "title=" Htop2.png "alt=" Wkiom1ifu2ohfnexaamxxgo8dai278.png "/>

Installation is complete!

Four. The options for the top command are detailed.

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/8D/17/wKiom1iFxADhflAVAANhZkicXm0187.png "title=" Htop3.png "alt=" Wkiom1ifxadhflavaanhzkicxm0187.png "/>

The first region: CPU, memory, swap usage;

The second area: task, average load, system running time, etc.

Third zone: All processes in the current system;

Area Four: The shortcut functions defined in the F1-F10 function keys in the current interface, where:

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/8D/18/wKiom1iFz-ujy8NkAACA2ZgFU2M034.png "title=" Htop4.png "alt=" Wkiom1ifz-ujy8nkaaca2zgfu2m034.png "/>

Note:

1) The average load section provides three numbers, which represent only the average load of the last 5, 10, and 15 minute systems, and in a single core system, an average load of 1 represents a total CPU utilization.

2) The running time (uptime) is indicated by the number is from the system start to the current total running time, that is, the boot time;

Common Interactive Commands:

1) space marks a process (similar to Windows pressing CTRL multiple selection)

2) U cancel all marks;

3) L show the files that the process is calling;

4) u display specific user;

5) M Sort by memory;

6) P is sorted by CPU;

7) T According to the length of the online order;

8) Ctrl + L refresh;

9) Directly enter the number to find the corresponding PID process;

Five. Htop command operation example.

1. Display the help information that comes with the htop command:

Mouse click on the help of Area IV or press F1 or press H to view:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/8D/16/wKioL1iF1KOTVDDOAAHTfks4T6g587.png "title=" Htop5.png "alt=" Wkiol1if1kotvddoaahtfks4t6g587.png "/>

2. Mouse click Setup or press F2 to set.

You can set the display of the 12th area or add or subtract certain display items, and you can arrange and add or subtract certain display items to the contents of the third area.

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/8D/16/wKioL1iF14-CBwY6AAFlDZI3Bt8053.png "title=" Htop6.png "alt=" Wkiol1if14-cbwy6aafldzi3bt8053.png "/>

The first step, through the mouse click or the cursor movement is selected; the second step, press space key (that is, the space bar), you can select the first region corresponding to the option to show in what form!

Isn't it simple?

You can also customize what is displayed in the process area:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/8D/16/wKioL1iF22XR_ggSAAFC5bZxdT0836.png "title=" Htop7.png "alt=" Wkiol1if22xr_ggsaafc5bzxdt0836.png "/>

3. Mouse click Search or F3:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/8D/16/wKioL1iF3V-hGBFsAALi9bUxhbI668.png "title=" Htop8.png "alt=" Wkiol1if3v-hgbfsaali9buxhbi668.png "/>

4. Use the spacebar to set the color callout process entry.

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/8D/19/wKiom1iF3h7AsaCEAAM1mAU9DF4347.png "title=" Htop9.png "alt=" Wkiom1if3h7asaceaam1mau9df4347.png "/>

This approach makes it easy to track the processes you want to see.

Six. Htop command-line options.

    • - s option : Sorts by the specified column. For example, thehtop-s pid command is displayed according to the size of the PID column.

    • - u option : Displays a list of process information for the specified user. For example, thehtop-u yangbin command displays only the related processes with the user name "Yangbin".

    • - d option : Sets the delay time for the refresh. For example, thehtop-d command causes the output to refresh after 1 seconds (the parameter-D unit is 10 microseconds).

Seven. Alias top.

Maybe we're all used to top, so we can use top to open htop by setting aliases.

To edit the/ETC/BASHRC file, add the following code at the end:

if [-f/usr/local/htop-2.0.2/bin/htop]; Then alias top= '/usr/local/htop-2.0.2/bin/htop '//note path. Fi

You can then run SOURCE/ETC/BASHRC to take effect.

The underlying operation to this htop command is complete! **************************************


This blog completion of reference to other sites related information, the address is as follows:

Http://www.wtoutiao.com/p/e1fpLY.html

Https://linux.cn/article-3141-1.html

This article is from the "Yangbin" blog, make sure to keep this source http://13683137989.blog.51cto.com/9636221/1893953

Htop-Powerful Process management tools

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.