架构师成长之路-系统监控工具htop

点击返回架构师成长之路

架构师成长之路-系统监控工具htop

htop 是Linux系统中的一个互动的进程查看器,一个文本模式的应用程序(在控制台或者X终端中),需要ncurses。

与Linux传统的top相比,htop更加人性化。它可让用户交互式操作,支持颜色主题,可横向或纵向滚动浏览进程列表,并支持鼠标操作。

与top相比,htop有以下优点:

  • 可以横向或纵向滚动浏览进程列表,以便看到所有的进程和完整的命令行。
  • 在启动上,比top 更快。
  • 杀进程时不需要输入进程号。
  • htop 支持鼠标操作。
  • 支持进程树状显示、按名称查找进程
    (显示进程打开的文件<打开htop后选择某一个进程,按s键即可用strace追踪进程的系统调用>,及显示进程内存映射情况。)

1. htop获取与安装

Htop的安装,既可以通过源码包编译安装,也可以配置好yum源后网络下载安装。

本文介绍源码安装

已经将文件下载在linux系统上面,然后解包。

  •  步骤2、要解包一个软件的tarball,使用标准的tar命令。 
  •  步骤3、cd进入目录后,检查系统拥有合适的编译器能够编译源代码,make构建各种二进制文件

        tar -zxvf htop-1.0.2.tar.gz

[root@CactiEZ /]# tar -zxvf htop-1.0.2.tar.gz
htop-1.0.2/
htop-1.0.2/config.sub
htop-1.0.2/htop.1.in
htop-1.0.2/AvailableMetersPanel.h
htop-1.0.2/Settings.h
htop-1.0.2/CategoriesPanel.c
htop-1.0.2/OpenFilesScreen.c
htop-1.0.2/UptimeMeter.c
htop-1.0.2/MetersPanel.c
htop-1.0.2/install-sh
htop-1.0.2/README
htop-1.0.2/AvailableColumnsPanel.c
htop-1.0.2/MemoryMeter.c
htop-1.0.2/SignalsPanel.c
htop-1.0.2/SwapMeter.h
htop-1.0.2/FunctionBar.c
htop-1.0.2/AvailableMetersPanel.c
htop-1.0.2/TasksMeter.c
htop-1.0.2/CategoriesPanel.h
htop-1.0.2/htop.c
htop-1.0.2/Vector.h
htop-1.0.2/Makefile.am
htop-1.0.2/autogen.sh
htop-1.0.2/BatteryMeter.h
htop-1.0.2/Affinity.h
htop-1.0.2/aclocal.m4
htop-1.0.2/LoadAverageMeter.h
htop-1.0.2/CheckItem.h
htop-1.0.2/htop.png
htop-1.0.2/configure
htop-1.0.2/FunctionBar.h
htop-1.0.2/depcomp
htop-1.0.2/Header.h
htop-1.0.2/IOPriority.c
htop-1.0.2/ColumnsPanel.h
htop-1.0.2/ColumnsPanel.c
htop-1.0.2/m4/
htop-1.0.2/m4/lt~obsolete.m4
htop-1.0.2/m4/ltoptions.m4
htop-1.0.2/m4/ltsugar.m4
htop-1.0.2/m4/ltversion.m4
htop-1.0.2/m4/libtool.m4
htop-1.0.2/UptimeMeter.h
htop-1.0.2/ListItem.h
htop-1.0.2/SignalsPanel.h
htop-1.0.2/IOPriorityPanel.h
htop-1.0.2/Settings.c
htop-1.0.2/htop.1
htop-1.0.2/configure.ac
htop-1.0.2/Meter.h
htop-1.0.2/MemoryMeter.h
htop-1.0.2/Header.c
htop-1.0.2/IOPriorityPanel.c
htop-1.0.2/CPUMeter.c
htop-1.0.2/ChangeLog
htop-1.0.2/UsersTable.c
htop-1.0.2/ltmain.sh
htop-1.0.2/HostnameMeter.h
htop-1.0.2/Affinity.c
htop-1.0.2/Hashtable.c
htop-1.0.2/BatteryMeter.c
htop-1.0.2/config.h
htop-1.0.2/Meter.c
htop-1.0.2/htop.desktop
htop-1.0.2/config.h.in
htop-1.0.2/RichString.c
htop-1.0.2/OpenFilesScreen.h
htop-1.0.2/String.h
htop-1.0.2/ClockMeter.c
htop-1.0.2/Process.h
htop-1.0.2/RichString.h
htop-1.0.2/ClockMeter.h
htop-1.0.2/AffinityPanel.h
htop-1.0.2/CRT.h
htop-1.0.2/ListItem.c
htop-1.0.2/SwapMeter.c
htop-1.0.2/CPUMeter.h
htop-1.0.2/Panel.c
htop-1.0.2/Panel.h
htop-1.0.2/ProcessList.h
htop-1.0.2/Object.h
htop-1.0.2/LoadAverageMeter.c
htop-1.0.2/AffinityPanel.c
htop-1.0.2/Process.c
htop-1.0.2/ScreenManager.h
htop-1.0.2/MetersPanel.h
htop-1.0.2/String.c
htop-1.0.2/INSTALL
htop-1.0.2/UsersTable.h
htop-1.0.2/TasksMeter.h
htop-1.0.2/NEWS
htop-1.0.2/CRT.c
htop-1.0.2/htop.h
htop-1.0.2/TraceScreen.h
htop-1.0.2/AUTHORS
htop-1.0.2/ScreenManager.c
htop-1.0.2/ColorsPanel.c
htop-1.0.2/TraceScreen.c
htop-1.0.2/DisplayOptionsPanel.h
htop-1.0.2/ProcessList.c
htop-1.0.2/CheckItem.c
htop-1.0.2/IOPriority.h
htop-1.0.2/AvailableColumnsPanel.h
htop-1.0.2/compile
htop-1.0.2/HostnameMeter.c
htop-1.0.2/Makefile.in
htop-1.0.2/Object.c
htop-1.0.2/ColorsPanel.h
htop-1.0.2/Vector.c
htop-1.0.2/DisplayOptionsPanel.c
htop-1.0.2/scripts/
htop-1.0.2/scripts/MakeHeader.py
htop-1.0.2/missing
htop-1.0.2/COPYING
htop-1.0.2/Hashtable.h
htop-1.0.2/config.guess
[root@CactiEZ /]# 
tar -zxvf htop-1.0.2.tar.gz

提示没有安装GNC C编辑器。以下安装GNC C编辑器 。

yum -y install gcc

[root@CactiEZ /]# yum -y install gcc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.tuna.tsinghua.edu.cn
 * updates: mirrors.tuna.tsinghua.edu.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package gcc.i686 0:4.4.7-23.el6 set to be updated
--> Processing Dependency: libgomp = 4.4.7-23.el6 for package: gcc-4.4.7-23.el6.i686
--> Processing Dependency: cpp = 4.4.7-23.el6 for package: gcc-4.4.7-23.el6.i686
--> Processing Dependency: libgcc >= 4.4.7-23.el6 for package: gcc-4.4.7-23.el6.i686
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.4.7-23.el6.i686
--> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.7-23.el6.i686
--> Processing Dependency: libgomp.so.1 for package: gcc-4.4.7-23.el6.i686
--> Running transaction check
---> Package cloog-ppl.i686 0:0.15.7-1.2.el6 set to be updated
--> Processing Dependency: libppl_c.so.2 for package: cloog-ppl-0.15.7-1.2.el6.i686
--> Processing Dependency: libppl.so.7 for package: cloog-ppl-0.15.7-1.2.el6.i686
---> Package cpp.i686 0:4.4.7-23.el6 set to be updated
--> Processing Dependency: libmpfr.so.1 for package: cpp-4.4.7-23.el6.i686
---> Package glibc-devel.i686 0:2.12-1.212.el6 set to be updated
--> Processing Dependency: glibc-headers = 2.12-1.212.el6 for package: glibc-devel-2.12-1.212.el6.i686
--> Processing Dependency: glibc = 2.12-1.212.el6 for package: glibc-devel-2.12-1.212.el6.i686
--> Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.212.el6.i686
---> Package libgcc.i686 0:4.4.7-23.el6 set to be updated
---> Package libgomp.i686 0:4.4.7-23.el6 set to be updated
--> Running transaction check
--> Processing Dependency: glibc = 2.12-1.7.el6 for package: glibc-common-2.12-1.7.el6.i686
---> Package glibc.i686 0:2.12-1.212.el6 set to be updated
---> Package glibc-headers.i686 0:2.12-1.212.el6 set to be updated
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.12-1.212.el6.i686
--> Processing Dependency: kernel-headers for package: glibc-headers-2.12-1.212.el6.i686
---> Package mpfr.i686 0:2.4.1-6.el6 set to be updated
---> Package ppl.i686 0:0.10.2-11.el6 set to be updated
--> Running transaction check
---> Package glibc-common.i686 0:2.12-1.212.el6 set to be updated
--> Processing Dependency: tzdata >= 2015g-4 for package: glibc-common-2.12-1.212.el6.i686
---> Package kernel-headers.i686 0:2.6.32-754.3.5.el6 set to be updated
--> Running transaction check
---> Package tzdata.noarch 0:2018e-3.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================
 Package                            Arch                       Version                                Repository                   Size
========================================================================================================================================
Installing:
 gcc                                i686                       4.4.7-23.el6                           base                        8.2 M
Installing for dependencies:
 cloog-ppl                          i686                       0.15.7-1.2.el6                         base                         93 k
 cpp                                i686                       4.4.7-23.el6                           base                        3.4 M
 glibc-devel                        i686                       2.12-1.212.el6                         base                        991 k
 glibc-headers                      i686                       2.12-1.212.el6                         base                        628 k
 kernel-headers                     i686                       2.6.32-754.3.5.el6                     updates                     4.5 M
 libgomp                            i686                       4.4.7-23.el6                           base                        137 k
 mpfr                               i686                       2.4.1-6.el6                            base                        153 k
 ppl                                i686                       0.10.2-11.el6                          base                        1.3 M
Updating for dependencies:
 glibc                              i686                       2.12-1.212.el6                         base                        4.4 M
 glibc-common                       i686                       2.12-1.212.el6                         base                         14 M
 libgcc                             i686                       4.4.7-23.el6                           base                        115 k
 tzdata                             noarch                     2018e-3.el6                            base                        495 k

Transaction Summary
========================================================================================================================================
Install       9 Package(s)
Upgrade       4 Package(s)

Total download size: 38 M
Downloading Packages:
(1/13): cloog-ppl-0.15.7-1.2.el6.i686.rpm                                                                        |  93 kB     00:00     
(2/13): cpp-4.4.7-23.el6.i686.rpm                                                                                | 3.4 MB     00:09     
(3/13): gcc-4.4.7-23.el6.i686.rpm                                                                                | 8.2 MB     00:23     
(4/13): glibc-2.12-1.212.el6.i686.rpm                                                                            | 4.4 MB     00:12     
(5/13): glibc-common-2.12-1.212.el6.i686.rpm                                                                     |  14 MB     00:41     
(6/13): glibc-devel-2.12-1.212.el6.i686.rpm                                                                      | 991 kB     00:02     
(7/13): glibc-headers-2.12-1.212.el6.i686.rpm                                                                    | 628 kB     00:01     
(8/13): kernel-headers-2.6.32-754.3.5.el6.i686.rpm                                                               | 4.5 MB     00:13     
(9/13): libgcc-4.4.7-23.el6.i686.rpm                                                                             | 115 kB     00:00     
(10/13): libgomp-4.4.7-23.el6.i686.rpm                                                                           | 137 kB     00:00     
(11/13): mpfr-2.4.1-6.el6.i686.rpm                                                                               | 153 kB     00:00     
(12/13): ppl-0.10.2-11.el6.i686.rpm                                                                              | 1.3 MB     00:03     
(13/13): tzdata-2018e-3.el6.noarch.rpm                                                                           | 495 kB     00:01     
----------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                   352 kB/s |  38 MB     01:52     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating       : libgcc-4.4.7-23.el6.i686                                                                                        1/17 
  Updating       : tzdata-2018e-3.el6.noarch                                                                                       2/17 
  Installing     : kernel-headers-2.6.32-754.3.5.el6.i686                                                                          3/17 
  Updating       : glibc-common-2.12-1.212.el6.i686                                                                                4/17 
  Updating       : glibc-2.12-1.212.el6.i686                                                                                       5/17 
  Installing     : glibc-headers-2.12-1.212.el6.i686                                                                               6/17 
  Installing     : libgomp-4.4.7-23.el6.i686                                                                                       7/17 
  Installing     : mpfr-2.4.1-6.el6.i686                                                                                           8/17 
  Installing     : cpp-4.4.7-23.el6.i686                                                                                           9/17 
  Installing     : ppl-0.10.2-11.el6.i686                                                                                         10/17 
  Installing     : glibc-devel-2.12-1.212.el6.i686                                                                                11/17 
  Installing     : cloog-ppl-0.15.7-1.2.el6.i686                                                                                  12/17 
  Installing     : gcc-4.4.7-23.el6.i686                                                                                          13/17 
  Cleanup        : glibc-common-2.12-1.7.el6.i686                                                                                 14/17 
  Cleanup        : glibc-2.12-1.7.el6.i686                                                                                        15/17 
  Cleanup        : tzdata-2010l-1.el6.noarch                                                                                      16/17 
  Cleanup        : libgcc-4.4.4-13.el6.i686                                                                                       17/17 

Installed:
  gcc.i686 0:4.4.7-23.el6                                                                                                               

Dependency Installed:
  cloog-ppl.i686 0:0.15.7-1.2.el6             cpp.i686 0:4.4.7-23.el6                          glibc-devel.i686 0:2.12-1.212.el6        
  glibc-headers.i686 0:2.12-1.212.el6         kernel-headers.i686 0:2.6.32-754.3.5.el6         libgomp.i686 0:4.4.7-23.el6              
  mpfr.i686 0:2.4.1-6.el6                     ppl.i686 0:0.10.2-11.el6                        

Dependency Updated:
  glibc.i686 0:2.12-1.212.el6     glibc-common.i686 0:2.12-1.212.el6     libgcc.i686 0:4.4.7-23.el6     tzdata.noarch 0:2018e-3.el6    

Complete!
You have new mail in /var/spool/mail/root
[root@CactiEZ /]# ^C
yum -y install gcc

 再次使用 ./configure 确保系统拥有合适的编译器能够编译源代码。及具备正确的库依赖关系。

[root@CactiEZ htop-1.0.2]#  ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc and cc understand -c and -o together... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1966080
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for ceil in -lm... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for ANSI C header files... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking curses.h usability... no
checking curses.h presence... no
checking for curses.h... no
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking for pid_t... yes
checking for uid_t in sys/types.h... yes
checking whether closedir returns void... no
checking return type of signal handlers... void
checking whether lstat correctly handles trailing slash... yes
checking whether stat accepts an empty string... no
checking for memmove... yes
checking for strncasecmp... yes
checking for strstr... yes
checking for strdup... yes
checking whether gcc -std=c99 option works... yes
checking for refresh in -lncursesw... no
configure: error: You may want to use --disable-unicode or install libncursesw.
./configure

最后一段出现错误:

configure: error: You may want to use --disable-unicode or install libncursesw.

需要安装 ncurses-devel

yum install ncurses-devel

[root@CactiEZ htop-1.0.2]# yum install ncurses-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.tuna.tsinghua.edu.cn
 * updates: mirrors.tuna.tsinghua.edu.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ncurses-devel.i686 0:5.7-4.20090207.el6 set to be updated
--> Processing Dependency: ncurses-libs = 5.7-4.20090207.el6 for package: ncurses-devel-5.7-4.20090207.el6.i686
--> Processing Dependency: pkgconfig for package: ncurses-devel-5.7-4.20090207.el6.i686
--> Processing Dependency: /usr/bin/pkg-config for package: ncurses-devel-5.7-4.20090207.el6.i686
--> Running transaction check
---> Package ncurses-libs.i686 0:5.7-4.20090207.el6 set to be updated
--> Processing Dependency: ncurses-base = 5.7-4.20090207.el6 for package: ncurses-libs-5.7-4.20090207.el6.i686
---> Package pkgconfig.i686 1:0.23-9.1.el6 set to be updated
--> Running transaction check
---> Package ncurses-base.i686 0:5.7-4.20090207.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================
 Package                            Arch                      Version                                   Repository                 Size
========================================================================================================================================
Installing:
 ncurses-devel                      i686                      5.7-4.20090207.el6                        base                      641 k
Installing for dependencies:
 pkgconfig                          i686                      1:0.23-9.1.el6                            base                       67 k
Updating for dependencies:
 ncurses-base                       i686                      5.7-4.20090207.el6                        base                       61 k
 ncurses-libs                       i686                      5.7-4.20090207.el6                        base                      249 k

Transaction Summary
========================================================================================================================================
Install       2 Package(s)
Upgrade       2 Package(s)

Total download size: 1.0 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): ncurses-base-5.7-4.20090207.el6.i686.rpm                                                                  |  61 kB     00:00     
(2/4): ncurses-devel-5.7-4.20090207.el6.i686.rpm                                                                 | 641 kB     00:01     
(3/4): ncurses-libs-5.7-4.20090207.el6.i686.rpm                                                                  | 249 kB     00:00     
(4/4): pkgconfig-0.23-9.1.el6.i686.rpm                                                                           |  67 kB     00:00     
----------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                   320 kB/s | 1.0 MB     00:03     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating       : ncurses-base-5.7-4.20090207.el6.i686                                                                             1/6 
  Updating       : ncurses-libs-5.7-4.20090207.el6.i686                                                                             2/6 
  Installing     : 1:pkgconfig-0.23-9.1.el6.i686                                                                                    3/6 
  Installing     : ncurses-devel-5.7-4.20090207.el6.i686                                                                            4/6 
  Cleanup        : ncurses-libs-5.7-3.20090208.el6.i686                                                                             5/6 
  Cleanup        : ncurses-base-5.7-3.20090208.el6.i686                                                                             6/6 

Installed:
  ncurses-devel.i686 0:5.7-4.20090207.el6                                                                                               

Dependency Installed:
  pkgconfig.i686 1:0.23-9.1.el6                                                                                                         

Dependency Updated:
  ncurses-base.i686 0:5.7-4.20090207.el6                             ncurses-libs.i686 0:5.7-4.20090207.el6                            

Complete!
[root@CactiEZ htop-1.0.2]# 
yum install ncurses-devel

重新执行./configure 

然后,make构建各种二进制文件

[root@CactiEZ htop-1.0.2]# make 
make  all-am
make[1]: Entering directory `/htop-1.0.2'
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-AvailableMetersPanel.o -MD -MP -MF .deps/htop-AvailableMetersPanel.Tpo -c -o htop-AvailableMetersPanel.o `test -f 'AvailableMetersPanel.c' || echo './'`AvailableMetersPanel.c
mv -f .deps/htop-AvailableMetersPanel.Tpo .deps/htop-AvailableMetersPanel.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-CategoriesPanel.o -MD -MP -MF .deps/htop-CategoriesPanel.Tpo -c -o htop-CategoriesPanel.o `test -f 'CategoriesPanel.c' || echo './'`CategoriesPanel.c
mv -f .deps/htop-CategoriesPanel.Tpo .deps/htop-CategoriesPanel.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-CheckItem.o -MD -MP -MF .deps/htop-CheckItem.Tpo -c -o htop-CheckItem.o `test -f 'CheckItem.c' || echo './'`CheckItem.c
mv -f .deps/htop-CheckItem.Tpo .deps/htop-CheckItem.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-ClockMeter.o -MD -MP -MF .deps/htop-ClockMeter.Tpo -c -o htop-ClockMeter.o `test -f 'ClockMeter.c' || echo './'`ClockMeter.c
mv -f .deps/htop-ClockMeter.Tpo .deps/htop-ClockMeter.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-ColorsPanel.o -MD -MP -MF .deps/htop-ColorsPanel.Tpo -c -o htop-ColorsPanel.o `test -f 'ColorsPanel.c' || echo './'`ColorsPanel.c
mv -f .deps/htop-ColorsPanel.Tpo .deps/htop-ColorsPanel.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-ColumnsPanel.o -MD -MP -MF .deps/htop-ColumnsPanel.Tpo -c -o htop-ColumnsPanel.o `test -f 'ColumnsPanel.c' || echo './'`ColumnsPanel.c
mv -f .deps/htop-ColumnsPanel.Tpo .deps/htop-ColumnsPanel.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-CPUMeter.o -MD -MP -MF .deps/htop-CPUMeter.Tpo -c -o htop-CPUMeter.o `test -f 'CPUMeter.c' || echo './'`CPUMeter.c
mv -f .deps/htop-CPUMeter.Tpo .deps/htop-CPUMeter.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-CRT.o -MD -MP -MF .deps/htop-CRT.Tpo -c -o htop-CRT.o `test -f 'CRT.c' || echo './'`CRT.c
mv -f .deps/htop-CRT.Tpo .deps/htop-CRT.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-DisplayOptionsPanel.o -MD -MP -MF .deps/htop-DisplayOptionsPanel.Tpo -c -o htop-DisplayOptionsPanel.o `test -f 'DisplayOptionsPanel.c' || echo './'`DisplayOptionsPanel.c
mv -f .deps/htop-DisplayOptionsPanel.Tpo .deps/htop-DisplayOptionsPanel.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-FunctionBar.o -MD -MP -MF .deps/htop-FunctionBar.Tpo -c -o htop-FunctionBar.o `test -f 'FunctionBar.c' || echo './'`FunctionBar.c
mv -f .deps/htop-FunctionBar.Tpo .deps/htop-FunctionBar.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-Hashtable.o -MD -MP -MF .deps/htop-Hashtable.Tpo -c -o htop-Hashtable.o `test -f 'Hashtable.c' || echo './'`Hashtable.c
mv -f .deps/htop-Hashtable.Tpo .deps/htop-Hashtable.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-Header.o -MD -MP -MF .deps/htop-Header.Tpo -c -o htop-Header.o `test -f 'Header.c' || echo './'`Header.c
mv -f .deps/htop-Header.Tpo .deps/htop-Header.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-htop.o -MD -MP -MF .deps/htop-htop.Tpo -c -o htop-htop.o `test -f 'htop.c' || echo './'`htop.c
mv -f .deps/htop-htop.Tpo .deps/htop-htop.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-ListItem.o -MD -MP -MF .deps/htop-ListItem.Tpo -c -o htop-ListItem.o `test -f 'ListItem.c' || echo './'`ListItem.c
mv -f .deps/htop-ListItem.Tpo .deps/htop-ListItem.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-LoadAverageMeter.o -MD -MP -MF .deps/htop-LoadAverageMeter.Tpo -c -o htop-LoadAverageMeter.o `test -f 'LoadAverageMeter.c' || echo './'`LoadAverageMeter.c
mv -f .deps/htop-LoadAverageMeter.Tpo .deps/htop-LoadAverageMeter.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-MemoryMeter.o -MD -MP -MF .deps/htop-MemoryMeter.Tpo -c -o htop-MemoryMeter.o `test -f 'MemoryMeter.c' || echo './'`MemoryMeter.c
mv -f .deps/htop-MemoryMeter.Tpo .deps/htop-MemoryMeter.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-Meter.o -MD -MP -MF .deps/htop-Meter.Tpo -c -o htop-Meter.o `test -f 'Meter.c' || echo './'`Meter.c
mv -f .deps/htop-Meter.Tpo .deps/htop-Meter.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-MetersPanel.o -MD -MP -MF .deps/htop-MetersPanel.Tpo -c -o htop-MetersPanel.o `test -f 'MetersPanel.c' || echo './'`MetersPanel.c
mv -f .deps/htop-MetersPanel.Tpo .deps/htop-MetersPanel.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-Object.o -MD -MP -MF .deps/htop-Object.Tpo -c -o htop-Object.o `test -f 'Object.c' || echo './'`Object.c
mv -f .deps/htop-Object.Tpo .deps/htop-Object.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-Panel.o -MD -MP -MF .deps/htop-Panel.Tpo -c -o htop-Panel.o `test -f 'Panel.c' || echo './'`Panel.c
mv -f .deps/htop-Panel.Tpo .deps/htop-Panel.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-BatteryMeter.o -MD -MP -MF .deps/htop-BatteryMeter.Tpo -c -o htop-BatteryMeter.o `test -f 'BatteryMeter.c' || echo './'`BatteryMeter.c
mv -f .deps/htop-BatteryMeter.Tpo .deps/htop-BatteryMeter.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-Process.o -MD -MP -MF .deps/htop-Process.Tpo -c -o htop-Process.o `test -f 'Process.c' || echo './'`Process.c
mv -f .deps/htop-Process.Tpo .deps/htop-Process.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-ProcessList.o -MD -MP -MF .deps/htop-ProcessList.Tpo -c -o htop-ProcessList.o `test -f 'ProcessList.c' || echo './'`ProcessList.c
mv -f .deps/htop-ProcessList.Tpo .deps/htop-ProcessList.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-RichString.o -MD -MP -MF .deps/htop-RichString.Tpo -c -o htop-RichString.o `test -f 'RichString.c' || echo './'`RichString.c
mv -f .deps/htop-RichString.Tpo .deps/htop-RichString.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-ScreenManager.o -MD -MP -MF .deps/htop-ScreenManager.Tpo -c -o htop-ScreenManager.o `test -f 'ScreenManager.c' || echo './'`ScreenManager.c
mv -f .deps/htop-ScreenManager.Tpo .deps/htop-ScreenManager.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-Settings.o -MD -MP -MF .deps/htop-Settings.Tpo -c -o htop-Settings.o `test -f 'Settings.c' || echo './'`Settings.c
mv -f .deps/htop-Settings.Tpo .deps/htop-Settings.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-IOPriorityPanel.o -MD -MP -MF .deps/htop-IOPriorityPanel.Tpo -c -o htop-IOPriorityPanel.o `test -f 'IOPriorityPanel.c' || echo './'`IOPriorityPanel.c
mv -f .deps/htop-IOPriorityPanel.Tpo .deps/htop-IOPriorityPanel.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-SignalsPanel.o -MD -MP -MF .deps/htop-SignalsPanel.Tpo -c -o htop-SignalsPanel.o `test -f 'SignalsPanel.c' || echo './'`SignalsPanel.c
mv -f .deps/htop-SignalsPanel.Tpo .deps/htop-SignalsPanel.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-String.o -MD -MP -MF .deps/htop-String.Tpo -c -o htop-String.o `test -f 'String.c' || echo './'`String.c
mv -f .deps/htop-String.Tpo .deps/htop-String.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-SwapMeter.o -MD -MP -MF .deps/htop-SwapMeter.Tpo -c -o htop-SwapMeter.o `test -f 'SwapMeter.c' || echo './'`SwapMeter.c
mv -f .deps/htop-SwapMeter.Tpo .deps/htop-SwapMeter.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-TasksMeter.o -MD -MP -MF .deps/htop-TasksMeter.Tpo -c -o htop-TasksMeter.o `test -f 'TasksMeter.c' || echo './'`TasksMeter.c
mv -f .deps/htop-TasksMeter.Tpo .deps/htop-TasksMeter.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-TraceScreen.o -MD -MP -MF .deps/htop-TraceScreen.Tpo -c -o htop-TraceScreen.o `test -f 'TraceScreen.c' || echo './'`TraceScreen.c
mv -f .deps/htop-TraceScreen.Tpo .deps/htop-TraceScreen.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-UptimeMeter.o -MD -MP -MF .deps/htop-UptimeMeter.Tpo -c -o htop-UptimeMeter.o `test -f 'UptimeMeter.c' || echo './'`UptimeMeter.c
mv -f .deps/htop-UptimeMeter.Tpo .deps/htop-UptimeMeter.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-UsersTable.o -MD -MP -MF .deps/htop-UsersTable.Tpo -c -o htop-UsersTable.o `test -f 'UsersTable.c' || echo './'`UsersTable.c
mv -f .deps/htop-UsersTable.Tpo .deps/htop-UsersTable.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-Vector.o -MD -MP -MF .deps/htop-Vector.Tpo -c -o htop-Vector.o `test -f 'Vector.c' || echo './'`Vector.c
mv -f .deps/htop-Vector.Tpo .deps/htop-Vector.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-AvailableColumnsPanel.o -MD -MP -MF .deps/htop-AvailableColumnsPanel.Tpo -c -o htop-AvailableColumnsPanel.o `test -f 'AvailableColumnsPanel.c' || echo './'`AvailableColumnsPanel.c
mv -f .deps/htop-AvailableColumnsPanel.Tpo .deps/htop-AvailableColumnsPanel.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-AffinityPanel.o -MD -MP -MF .deps/htop-AffinityPanel.Tpo -c -o htop-AffinityPanel.o `test -f 'AffinityPanel.c' || echo './'`AffinityPanel.c
mv -f .deps/htop-AffinityPanel.Tpo .deps/htop-AffinityPanel.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-HostnameMeter.o -MD -MP -MF .deps/htop-HostnameMeter.Tpo -c -o htop-HostnameMeter.o `test -f 'HostnameMeter.c' || echo './'`HostnameMeter.c
mv -f .deps/htop-HostnameMeter.Tpo .deps/htop-HostnameMeter.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-OpenFilesScreen.o -MD -MP -MF .deps/htop-OpenFilesScreen.Tpo -c -o htop-OpenFilesScreen.o `test -f 'OpenFilesScreen.c' || echo './'`OpenFilesScreen.c
mv -f .deps/htop-OpenFilesScreen.Tpo .deps/htop-OpenFilesScreen.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-Affinity.o -MD -MP -MF .deps/htop-Affinity.Tpo -c -o htop-Affinity.o `test -f 'Affinity.c' || echo './'`Affinity.c
mv -f .deps/htop-Affinity.Tpo .deps/htop-Affinity.Po
gcc -DHAVE_CONFIG_H -I.  -DNDEBUG  -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -MT htop-IOPriority.o -MD -MP -MF .deps/htop-IOPriority.Tpo -c -o htop-IOPriority.o `test -f 'IOPriority.c' || echo './'`IOPriority.c
mv -f .deps/htop-IOPriority.Tpo .deps/htop-IOPriority.Po
/bin/sh ./libtool --tag=CC   --mode=link gcc -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2   -o htop  htop-AvailableMetersPanel.o htop-CategoriesPanel.o htop-CheckItem.o htop-ClockMeter.o htop-ColorsPanel.o htop-ColumnsPanel.o htop-CPUMeter.o htop-CRT.o htop-DisplayOptionsPanel.o htop-FunctionBar.o htop-Hashtable.o htop-Header.o htop-htop.o htop-ListItem.o htop-LoadAverageMeter.o htop-MemoryMeter.o htop-Meter.o htop-MetersPanel.o htop-Object.o htop-Panel.o htop-BatteryMeter.o htop-Process.o htop-ProcessList.o htop-RichString.o htop-ScreenManager.o htop-Settings.o htop-IOPriorityPanel.o htop-SignalsPanel.o htop-String.o htop-SwapMeter.o htop-TasksMeter.o htop-TraceScreen.o htop-UptimeMeter.o htop-UsersTable.o htop-Vector.o htop-AvailableColumnsPanel.o htop-AffinityPanel.o htop-HostnameMeter.o htop-OpenFilesScreen.o htop-Affinity.o htop-IOPriority.o  -lncursesw -lm 
libtool: link: gcc -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/usr/local/etc\" -g -O2 -o htop htop-AvailableMetersPanel.o htop-CategoriesPanel.o htop-CheckItem.o htop-ClockMeter.o htop-ColorsPanel.o htop-ColumnsPanel.o htop-CPUMeter.o htop-CRT.o htop-DisplayOptionsPanel.o htop-FunctionBar.o htop-Hashtable.o htop-Header.o htop-htop.o htop-ListItem.o htop-LoadAverageMeter.o htop-MemoryMeter.o htop-Meter.o htop-MetersPanel.o htop-Object.o htop-Panel.o htop-BatteryMeter.o htop-Process.o htop-ProcessList.o htop-RichString.o htop-ScreenManager.o htop-Settings.o htop-IOPriorityPanel.o htop-SignalsPanel.o htop-String.o htop-SwapMeter.o htop-TasksMeter.o htop-TraceScreen.o htop-UptimeMeter.o htop-UsersTable.o htop-Vector.o htop-AvailableColumnsPanel.o htop-AffinityPanel.o htop-HostnameMeter.o htop-OpenFilesScreen.o htop-Affinity.o htop-IOPriority.o  -lncursesw -lm
make[1]: Leaving directory `/htop-1.0.2'
[root@CactiEZ htop-1.0.2]# 
make

 安装完成。

2.htop参数

键入htop 命令,打开htop。

 

左边部分从上至下,分别为,cpu、内存、交换分区的使用情况,右边部分为:Tasks为进程总数,当前运行的进程数、Load average为系统1分钟,5分钟,10分钟的平均负载情况、Uptime为系统运行的时间。

,就是进程实时状况。

  • PID:进行的标识号
  • USER:运行此进程的用户
  • PRI:进程的优先级
  • NI:进程的优先级别值,默认的为0,可以进行调整
  • VIRT:进程占用的虚拟内存值
  • RES:进程占用的物理内存值
  • SHR:进程占用的共享内存值
  • S:进程的运行状况,R表示正在运行、S表示休眠,等待唤醒、Z表示僵死状态
  • %CPU:该进程占用的CPU使用率
  • %MEM:该进程占用的物理内存和总内存的百分比
  • TIME+:该进程启动后占用的总的CPU时间
  • COMMAND:进程启动的启动命令名称

下面是 F1~F10 的功能和对应的字母快捷键。

Shortcut Key Function Key Description 中文说明
h, ? F1 Invoke htop Help 查看htop使用说明
S F2 Htop Setup Menu htop 设定
/ F3 Search for a Process 搜索进程
\ F4 Incremental process filtering 增量进程过滤器
t F5 Tree View 显示树形结构
<, > F6 Sort by a column 选择排序方式
[ F7 Nice - (change priority) 可减少nice值,这样就可以提高对应进程的优先级
] F8 Nice + (change priority) 可增加nice值,这样就可以降低对应进程的优先级
k F9 Kill a Process 可对进程传递信号
q F10 Quit htop 结束htop

以下命令行选项(COMMAND-LINE OPTIONS)

  • -C --no-color        使用一个单色的配色方案
  • -d --delay=DELAY     设置延迟更新时间,单位秒
  • -h --help           显示htop 命令帮助信息
  • -u --user=USERNAME    只显示一个给定的用户的过程
  • -p --pid=PID,PID…       只显示给定的PIDs
  • -s --sort-key COLUMN     依此列来排序
  • -v –version          显示版本信息

 以下交互式命令(INTERACTIVE COMMANDS)

  • 上下键或PgUP, PgDn 选定想要的进程,左右键或Home, End 移动字段,当然也可以直接用鼠标选定进程;
  • Space    标记/取消标记一个进程。命令可以作用于多个进程,例如 "kill",将应用于所有已标记的进程
  • U    取消标记所有进程
  • s    选择某一进程,按s:用strace追踪进程的系统调用
  • l    显示进程打开的文件: 如果安装了lsof,按此键可以显示进程所打开的文件
  • I    倒转排序顺序,如果排序是正序的,则反转成倒序的,反之亦然
  • +, -    When in tree view mode, expand or collapse subtree. When a subtree is collapsed a "+" sign shows to the left of the process name.
  • a (在有多处理器的机器上)    设置 CPU affinity: 标记一个进程允许使用哪些CPU
  • u    显示特定用户进程
  •    按Memory 使用排序
  • P    按CPU 使用排序
  •    按Time+ 使用排序
  • F    跟踪进程: 如果排序顺序引起选定的进程在列表上到处移动,让选定条跟随该进程。这对监视一个进程非常有用:通过这种方式,你可以让一个进程在屏幕上一直可见。使用方向键会停止该功能。
  • K    显示/隐藏内核线程
  •    显示/隐藏用户线程
  • Ctrl-L    刷新
  • Numbers    PID 查找: 输入PID,光标将移动到相应的进程上

3.htop使用

3.1. 显示自带帮助

鼠标点击Help或者按F1 显示自带帮助

3.2. htop 设定

鼠标点击Setup或者按下F2 之后进入htop 设定的页面,Meters 页面设定了顶端的一些信息显示,顶端的显示又分为左右两侧,到底能显示些什么可以在最右侧那栏新增,要新增到上方左侧(F5)或是右侧(F6)都可以,这就是个人设定的范围了。这里多加了一个时钟。

 

 

 

......

posted on 2018-10-08 15:21  CARLOS_KONG  阅读(816)  评论(0编辑  收藏  举报

导航