top

command usage

1. Tool (command) name
top
2. The function of the tool (command)
displays the current process and other status of the system; top is a dynamic display process, that is, the current status can be continuously refreshed by the user's keystrokes. If the command is executed in the foreground, it will occupy the foreground until the user terminates the program. . To be more precise, the top command provides real-time monitoring of the status of the system processor. It will display a list of the most "sensitive" tasks in the system for the CPU. This command can sort tasks by CPU usage, memory usage and execution time ; And many features of this command can be set through interactive commands or in individual custom files. 
3. Environment settings
are used under Linux.
4. Usage
4.1 Use the format
top [-] [d] [p] [q] [c] [C] [S] [s] [n] 
4.2 Parameter description
d specifies the interval between every two screen information refreshes time interval. Of course the user can use the s interactive command to change it.
p Monitor only the status of a process by specifying the monitor process ID.
q This option will make top refresh without any delay. If the calling program has superuser privileges, then top will run with the highest possible priority.
S Specifies cumulative mode
s to make the top command run in safe mode. This removes the potential danger posed by interactive commands.
i makes top not show any idle or zombie processes.
c Display the entire command line instead of just the command name
4.3 Others
  The following describes some interactive commands that can be used during the execution of the top command. From a usage point of view, mastering these commands is more important than mastering the options. These commands are all single letter, if the s option is used in the command line options, some of these commands may be blocked.
  Ctrl+L Erase and rewrite the screen.
  h or ? Displays a help screen giving some brief command summaries.
  k terminates a process. The system will prompt the user to enter the PID of the process that needs to be terminated, and what kind of signal needs to be sent to that process. The general termination process can use the 15 signal; if it cannot be terminated normally, use the signal 9 to force the termination of the process. The default value is signal 15. This command is blocked in safe mode.
  i Ignore idle and zombie processes. This is a switch command.
  q Quit the program.
  r Reschedules the priority level of a process. The system prompts the user to input the process PID that needs to be changed and the process priority value that needs to be set. Entering a positive value will make the priority lower, otherwise it will make the process have a higher priority. The default value is 10.
  S Switch to accumulation mode.
  s Changes the delay time between refreshes. The system will prompt the user to enter a new time in seconds. If there is a decimal, it is converted to ms. If you enter a value of 0, the system will refresh continuously. The default value is 5 s. It should be noted that if the time is set too small, it is likely to cause continuous refresh, so that it is too late to see the display clearly, and the system load will be greatly increased.
  f or F Add or remove items from the current display.
  o or O Change the order of displayed items.
  l Toggle to display the average load and startup time information.
  m Toggles display of memory information.
  t Toggles display of process and CPU status information.
  c Toggles showing the command name and the full command line.
  M is sorted by resident memory size.
  P is sorted by CPU usage percentage size.
  T is sorted by time/cumulative time.
     W writes the current settings to the ~/.toprc file. This is the recommended way to write top configuration files.

 

over

 

 

top field meaning

列名 含义

PID 进程 ID
USER 进程所有者的用户名
PR 任务优先级
NI nice 值。数值越小表示优先级越高,数值越大表示优先级越低
VIRT 进程使用的虚拟内存总量,单位:kb。VIRT=SWAP+RES
RES 进程使用的、未被换出的物理内存大小,单位:kb。RES=CODE+DATA
SHR 共享内存大小,单位:kb
S 进程状态。
D= 不可中断的睡眠状态 
R= 运行 
S= 睡眠 
T= 跟踪 / 停止 
Z= 僵尸进程
%CPU 上次更新到现在的 CPU 时间占用百分比
TIME+ 进程使用的 CPU 时间总计,精确到 1/100 秒
COMMAND 命令名 / 命令行

 

 

 

Linux Top 命令解析 比较详细

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326359910&siteId=291194637
top