htop

HTOP在Centos7的安裝:
HTOP安裝
頂部作爲日常管理工作中最常用也是最重要的Linux的系統監控工具之一,可以動態觀察系統進程狀況

HTOP介紹
HTOP是Linux的系統下一個基本文本模式的,交互式的進程查看器,主要用於控制檯或殼中,可以替代頂部,或者說是頂級的高級版。

HTOP命令優點:

1) 快速查看關鍵性能統計數據,如CPU(多核佈局)、內存/交換使用;
2) 可以橫向或縱向滾動瀏覽進程列表,以查看所有的進程和完整的命令行;
3) 殺掉進程時可以直接選擇而不需要輸入進程號;
4) 通過鼠標操作條目;
5) 比top啓動得更快

HTOP安裝(centos7)

1.首先,在CentOS 7上啓用epel版本。

[root@hk-fa ~]# yum -y install epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyuncs.com
 * epel: mirrors.aliyuncs.com
 * extras: mirrors.aliyuncs.com
 * updates: mirrors.aliyuncs.com
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-9 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================================================================================================================================
 Package                                                                Arch                                                             Version                                                         Repository                                                      Size
==============================================================================================================================================================================================================================================================================
Installing:
 epel-release                                                           noarch                                                           7-9                                                             epel                                                            14 k

Transaction Summary
==============================================================================================================================================================================================================================================================================
Install  1 Package

Total download size: 14 k
Installed size: 24 k
Downloading packages:
epel-release-7-9.noarch.rpm                                                                                                                                                                                                                            |  14 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-9.noarch                                                                                                                                                                                                                                    1/1 
warning: /etc/yum.repos.d/epel.repo created as /etc/yum.repos.d/epel.repo.rpmnew
  Verifying  : epel-release-7-9.noarch                                                                                                                                                                                                                                    1/1 

Installed:
  epel-release.noarch 0:7-9                                                                                                                                                                                                                                                   

Complete!

2.使用yum install命令安裝CentOS htop:

[root@hk-fa ~]# yum -y install htop
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyuncs.com
 * epel: mirrors.aliyuncs.com
 * extras: mirrors.aliyuncs.com
 * updates: mirrors.aliyuncs.com
Resolving Dependencies
--> Running transaction check
---> Package htop.x86_64 0:2.0.2-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================================================================================================================================
 Package                                                        Arch                                                             Version                                                                 Repository                                                      Size
==============================================================================================================================================================================================================================================================================
Installing:
 htop                                                           x86_64                                                           2.0.2-1.el7                                                             epel                                                            98 k

Transaction Summary
==============================================================================================================================================================================================================================================================================
Install  1 Package

Total download size: 98 k
Installed size: 207 k
Downloading packages:
htop-2.0.2-1.el7.x86_64.rpm                                                                                                                                                                                                                            |  98 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : htop-2.0.2-1.el7.x86_64                                                                                                                                                                                                                                    1/1 
  Verifying  : htop-2.0.2-1.el7.x86_64                                                                                                                                                                                                                                    1/1 

Installed:
  htop.x86_64 0:2.0.2-1.el7                                                                                                                                                                                                                                                   

Complete!

3.運行HTOP命令:

在這裏插入圖片描述

HTOP常用功能鍵

F1 : 查看htop使用說明
F2 : 設置
F3 : 搜索進程
F4 : 過濾器,按關鍵字搜索
F5 : 顯示樹形結構
F6 : 選擇排序方式
F7 : 減少nice值,這樣就可以提高對應進程的優先級
F8 : 增加nice值,這樣可以降低對應進程的優先級
F9 : 殺掉選中的進程
F10 : 退出htop

/ : 搜索字符
h : 顯示幫助
l :顯示進程打開的文件: 如果安裝了lsof,按此鍵可以顯示進程所打開的文件
u :顯示所有用戶,並可以選擇某一特定用戶的進程
s : 將調用strace追蹤進程的系統調用
t : 顯示樹形結構

H :顯示/隱藏用戶線程
I :倒轉排序順序
K :顯示/隱藏內核線程    
M :按內存佔用排序
P :按CPU排序    
T :按運行時間排序

上下鍵或PgUP, PgDn : 移動選中進程
左右鍵或Home, End : 移動列表    
Space(空格) : 標記/取消標記一個進程。命令可以作用於多個進程,例如 "kill",將應用於所有已標記的進程

參考資料
Linux的下超級命令HTOP的學習使用

如何在CentOS 7上安裝htop

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章