查看 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
可以将空闲进程隐藏。