參考鏈接:https://www.cnblogs.com/peida/archive/2012/12/24/2831353.html
1.命令格式:
top[參數(shù)]
2.命令功能:
顯示當(dāng)前系統(tǒng)正在執(zhí)行的進(jìn)程的相關(guān)信息,包括進(jìn)程ID、內(nèi)存占用率、CPU占用率等
3.命令參數(shù):
-b批處理
-c顯示完整的治命令
-I忽略失效過(guò)程
-s保密模式
-S累積模式
-i<時(shí)間>設(shè)置間隔時(shí)間
-u<用戶名>指定用戶名
-p<進(jìn)程號(hào)>指定進(jìn)程
-n<次數(shù)>循環(huán)顯示的次數(shù)
4.使用實(shí)例:
(1)top
$ top
top - 16:29:34 up 6 days, 6:23, 6 users, load average: 0.00, 0.01, 0.05
Tasks: 466 total, 2 running, 463 sleeping, 1 stopped, 0 zombie
%Cpu(s): 1.5 us, 0.9 sy, 0.0 ni, 97.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
total used free shared buffers。 total used free shared buffers cached 。 total used free shared buffers cached。
mem: 16426352k total, 16085752k used, 340600k free, 1582444k buffers。total used free shared buffers cached。total used free shared buffers cached。
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2664 deliado+ 20 0 331732 7480 4612 S 0.2 0.2 0:00.85 polkit-gnome-au
2670 deliado+ 20 0 477104 7340 4504 S 0.2 0.2 0:00.70 unity-fallback-
2676 deliado+ 20 0 591128 12276 6880 S 0.2 0.3 0:01.28 nm-applet
17003 deliado+ 20 0 29432 2012 1192 R 0.2 0.0 0:00.39 top
1 root 20 0 33908 2852 1404 S 0.0 0.1 0:02.35 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.07 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:02.62 ksoftirqd/0
root 27 2 0 0 0 -20 0 0 fg c00b60a8 00000000 s kworker/0:1h。root 7 2 0 0 0 -20 0 0 fg c007e2e0 00000000 d kworker/u:0h。root 33 2 0 0 0 -20 0 0 fg c00b60a8 00000000 s kworker/u:1h。