- top命令是最常用的查看Linux系统信息的命令之一,可以实时显示系统中各个进程的资源占用情况。
top - 02:55:09 up 15 days, 5:35, 1 user, load average: 0.00, 0.02, 0.05
Tasks: 65 total, 1 running, 64 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.3 us, 0.3 sy, 0.0 ni, 99.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem(主存) : 1016164 total, 87432 free, 505544 used, 423188 buff/cache
KiB Swap(交换分区): 0 total, 0 free, 0 used. 356124 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1197 root 10 -10 126536 7940 5196 S 0.3 0.8 74:49.37 AliYunDun
1382 root 20 0 65376 2664 2224 S 0.3 0.3 3:33.74 aliyun-service
1 root 20 0 43268 3080 1864 S 0.0 0.3 1:27.90 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.06 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:02.81 ksoftirqd/0
5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
7 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
9 root 20 0 0 0 0 S 0.0 0.0 1:12.31 rcu_sched
10 root rt 0 0 0 0 S 0.0 0.0 0:07.27 watchdog/0
12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs
13 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns
14 root 20 0 0 0 0 S 0.0 0.0 0:00.45 khungtaskd
15 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 writeback
16 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kintegrityd
17 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
18 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kblockd
19 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 md
* PID = Process Id 进程的ID
* USER = Effective User Name 进程所有者的用户名
* PR = Priority 进程优先级
* NI = Nice Value 进程的nice值
* VIRT = Virtual Image (KiB) 进程使用的虚拟内存总量,单位是KB
* RES = Resident Size (KiB) 进程使用的并且未被换出的物理内存大小,单位是KB
* SHR = Shared Memory (KiB) 共享内存大小,单位是KB
* S = Process Status 进程的状态。(D=不可中断的睡眠状态,R=运行,S=睡眠,T=跟踪/停止,z=僵尸进程)
* %CPU = CPU Usage 上一次更新到现在的CPU时间占用百分比
* %MEM = Memory Usage (RES) 进程使用物理内存的百分比
* TIME+ = CPU Time, hundredths 进程使用的CPU时间总计,单位是10ms
* COMMAND = Command Name/Line 命令名或命令行
PPID = Parent Process pid
UID = Effective User Id
RUID = Real User Id
RUSER = Real User Name
SUID = Saved User Id
SUSER = Saved User Name
GID = Group Id
GROUP = Group Name
PGRP = Process Group Id
TTY = Controlling Tty
TPGID = Tty Process Grp Id
SID = Session Id
nTH = Number of Threads
P = Last Used Cpu (SMP)
TIME = CPU Time
SWAP = Swapped Size (KiB)
CODE = Code Size (KiB)
DATA = Data+Stack (KiB)
nMaj = Major Page Faults
nMin = Minor Page Faults
nDRT = Dirty Pages Count
WCHAN = Sleeping in Function
Flags = Task Flags <sched.h>
CGROUPS = Control Groups
SUPGIDS = Supp Groups IDs
SUPGRPS = Supp Groups Names
TGID = Thread Group Id
ENVIRON = Environment vars
vMj = Major Faults delta
vMn = Minor Faults delta
USED = Res+Swap Size (KiB)
nsIPC = IPC namespace Inode
nsMNT = MNT namespace Inode
nsNET = NET namespace Inode
nsPID = PID namespace Inode
nsUSER = USER namespace Inode
nsUTS = UTS namespace Inode