Linux Operating System (5): htop describes the installation and practical use

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/qq_41554005/article/details/94381446

Introduction

htop is one that will allow the user interacts Process Viewer, as the application text mode, the main user console or x terminal. Currently it has eucalyptus-like way to view the process, support for color themes, and other features can be customized.

Compared with the top, htop comprising advantages:

1, can be horizontal or vertical scroll through the list of processes, in order to view all of the processes and a complete command line.

2, faster start than at the top

3, the process does not need to kill the process ID

4, htop mouse support

installation

直接 sudo apt-get install htop

use

Command line tap htop command, you can enter htop interface

[Image dump outer link failure (img-LiKEV92T-1567736750349) (https://raw.githubusercontent.com/ZhouziqunZZQZZQ/picBed/master/20190701232957.png)]

Instructions for use:

[Image dump outer link failure (img-VW7VqgSv-1567736750350) (https://raw.githubusercontent.com/ZhouziqunZZQZZQ/picBed/master/20190701233028.png)]

Usage cpu, memory, swap, and the right part is: Tasks for the total number of processes, number of processes currently running, Load average for the system for 1 minute, 5 minutes, 10 minutes average load, Uptime for the system operation.

[Image dump outer link failure (img-aj7DLptg-1567736750352) (https://raw.githubusercontent.com/ZhouziqunZZQZZQ/picBed/master/20190701233046.png)]

  • PID: identification number of
  • USER: User to run this process
  • Priority of the process: PRI
  • NI: process priority value, the default is 0, can be adjusted
  • VIRT: virtual memory occupied by the process value
  • RES: the value of physical memory occupied by the process
  • SHR: process uses shared memory value
  • S: the health of the process, R means running, S for sleep, wake-up wait, Z represents a dead state
  • % CPU: the process consumes CPU usage
  • % MEM: The percentage occupied by the process of physical memory and total memory
  • TIME +: Total CPU time the process started after the occupation of
  • COMMAND: command name starts the process was started

Shortcuts F1: Displays help information

[Image dump outer link failure (img-SJoE5ajE-1567736750359) (https://raw.githubusercontent.com/ZhouziqunZZQZZQ/picBed/master/20190701233106.png)]

h,? F1 view htop Description
S F2 htop set
/ F3 search process
\ incremental process filters the F4
t F5 display tree
<,> F6 select the sorting
[F7 can reduce the nice value can increase the priority of the corresponding process
] increase the F8 nice value, corresponding to the process to reduce the priority
k F9 may transmit a signal to the process
q F10 end htop
U show only a given user process
U unmark all processes
H to show or hide the user thread
K show or hide kernel thread
F tracing process
P by using the CPU Sort
Sort memory M by using the
T by using a sort Time +
l show the process of opening the file
I reverse sort order
s selection of a process, according to s: process with call tracking system strace

Shortcuts F2: Htop set

Enter htop set after a mouse click or press F2 Setup page

Under the Setup options:

[Image dump outer link failure (img-sTEbnHkd-1567736750360) (https://raw.githubusercontent.com/ZhouziqunZZQZZQ/picBed/master/20190701232605.png)]

1.Meters

Set the top of the display is divided into left and right sides, Left column represents the information displayed on the left side, Right column represents the information shown on the right, if you want to add a new option, you can choose to add Available meters, F5 added to the upper left side, F6 added to the top right. Left column and Right column the following options, display information can be selected, there are LED, Bar (progress bar), Text (text mode) can be set according to personal preference

2.Display options


Select the content to be displayed, press the space x denotes a display, select finished, press F10 to save

3.Colors

[Picture outside the chain dump failure (img-zUECXeYv-1567736750363) ( https://raw.githubusercontent.com/ZhouziqunZZQZZQ/picBed/master/20190701232655.png)]
setting screen to display what color, think of little use , different from their preferences, if we choose Black on White display the following effects
[image dump outer link failure (img-djkBe18R-1567736750365) ( https://raw.githubusercontent.com/ZhouziqunZZQZZQ/picBed/master/20190701232709.png )]

4.Colums


Role is to increase or cancel the contents to be displayed, F7 (moving up) is selected, F8 (move down), F9 (canceled show, F10 (to save changes)) here adds PPID, PGRP, according to their needs to display that information.

F3 search process

In the interface, press F3 or enter "/" you can directly enter the search mode, a search is carried out in accordance with the process name. For example
[image dump outer link failure (img-4HYsqnKA-1567736750368) ( https://raw.githubusercontent.com/ZhouziqunZZQZZQ/picBed/master/20190701232732.png)]
search process will be marked with a color setting, for easy viewing

F4: Filter

After the equivalent of fuzzy search is not case sensitive, enter what you are searching downward, the screen only displays the searched content, more convenient to view, for example:

[Image dump outer link failure (img-TQ7SWmzB-1567736750369) (https://raw.githubusercontent.com/ZhouziqunZZQZZQ/picBed/master/20190701232751.png)]

F5: display a tree way

F6: Sort

[Image dump outer link failure (img-8sRt2vEp-1567736750373) (https://raw.githubusercontent.com/ZhouziqunZZQZZQ/picBed/master/20190701232815.png)]

After pressing F6 will jump first map interface, allowing you to choose in what way to sort, select what you want to sort in the Sort by

F7, F8: adjustment process nice value

F7 represents a nice value decrease (increase priority), F8 nice value increases (decreases priority), select a process, press F7 or F8 nice value to increase or decrease, nice value in the range of -20- 19, where I put the nice value apache adjusted to 19
[picture outside the chain dump failure (img-vivWs2MT-1567736750375) ( https://raw.githubusercontent.com/ZhouziqunZZQZZQ/picBed/master/20190701232848.png)]

F9: kill the process

Press F9 to select a process to kill this process, it is convenient

F10: Exit htop

four. End

These are the basic usage of htop, thank you for watching, I believe we can feel Htop advantage over the top. If there is something wrong with the trouble to inform the message for next change, thank you.

Guess you like

Origin blog.csdn.net/qq_41554005/article/details/94381446