天天看點

Linux CentOS 8 檢視系統程序資訊

檢視

top

man
#man top information
$man top 
NAME
       top - display Linux processes

SYNOPSIS
       top -hv|-bcEHiOSs1 -d secs -n max -u|U user -p pid -o fld -w [cols]

       The traditional switches `-' and whitespace are optional.

DESCRIPTION
       The top program provides a dynamic real-time view of a running system.  It can display system summary information as well as a list of pro‐
       cesses or threads currently being managed by the Linux kernel.  The types of system summary information shown and the types, order and size
       of information displayed for processes are all user configurable and that configuration can be made persistent across restarts.

       The  program provides a limited interactive interface for process manipulation as well as a much more extensive interface for personal con‐
       figuration  --  encompassing every aspect of its operation.  And while top is referred to throughout this document, you are  free  to  name
       the program anything you wish.  That new name, possibly an alias, will then be reflected on top's display and used when reading and writing
       a configuration file.           

top -h

[arthur@localhost ~]$ top -help
  procps-ng 3.3.15
Usage:
  top -hv | -bcEHiOSs1 -d secs -n max -u|U user -p pid(s) -o field -w [cols]           
檢視系統程序動态資訊
#example: 
$top
top - 11:55:48 up 14:34,  1 user,  load average: 0.54, 0.30, 0.13
Tasks: 276 total,   2 running, 274 sleeping,   0 stopped,   0 zombie
%Cpu(s):  3.1 us,  1.5 sy,  0.0 ni, 94.8 id,  0.0 wa,  0.4 hi,  0.2 si,  0.0 st
MiB Mem :   9356.3 total,   4824.7 free,   1896.4 used,   2635.2 buff/cache
MiB Swap:   4848.0 total,   4848.0 free,      0.0 used.   6934.0 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                        
   2887 arthur    20   0 4487204 204476 109484 S   6.0   2.1   0:59.54 gnome-shell                                                                    
   1021 root     -51   0       0      0      0 D   3.3   0.0   0:10.28 irq/37-rmi4_smb                                                                
   3670 arthur    20   0  767400  50208  36212 S   2.7   0.5   0:09.45 gnome-terminal-                                                                
  32549 arthur    20   0   16.8g 108524  74992 S   2.7   1.1   0:07.81 chrome                                                                         
  32719 arthur    20   0   20.8g 216424 130188 S   2.7   2.3   0:17.09 chrome                                                  

注釋:

PID (Process ID) : 程序辨別号 ; USER: 程序使用者; PR(Priority):優先級别,數值越小優先級越高; NI (Nice): Nice value of task. 優先級别數值(數值越小越先執行); VIRT : 程序占用的虛拟記憶體值; RES : 程序占用的實體記憶體值; SHR : 程序使用的共享記憶體值; S : 程序狀态(S : sleep; D: 不可中斷睡眠狀态; R : 正在運作 ); %CPU : 程序占用的CPU 使用率; %MEM : 程序占用實體記憶體的百分比 ; TIME+ : 程序啟用後占用的CPU 時間

其他:

top

顯示目前最近運作的所有程序。

top -i

可以将空閑程序隐藏。

繼續閱讀