TOP command details

  

top command

The basic functions of the top command and the ps command are the same, showing the current process and other conditions of the system; but top is a dynamic display process, that is, through the user button Keep refreshing the current state. If the foreground executes the command, it will monopolize the foreground until the user terminates the program. More accurately, the top command provides real-time status monitoring of the system processor. It will display a list of the most "sensitive" tasks for the CPU in the system. This command can be used by the CPU. The memory usage and execution time sort the tasks; and many of the features of the command can be set via interactive commands or in a personal customization file. The command parameters and interactive commands will be described separately in the following introduction.


The following is the syntax of the command:

top [-] [d delay] [q] [c] [s] [S] [i] < Br>

d Specifies the time interval between each refresh of the screen information. Of course, the user can use the s interactive command to change it.

q This option will cause top to refresh without any delay. If the caller has superuser privileges, then top will run with the highest possible priority.

S Specifies the cumulative mode.

s Make the top command run in safe mode. This will remove the potential danger of interactive commands.

i Make top not show any idle or zombie processes.

c Display the entire command line instead of just displaying the command name

The top command displays a lot of items. The default value is updated every 5 seconds. Of course, this can be set. The items displayed are:

uptime This item shows the system startup time, the time that has been run, and the three average load values ​​(last 1 second, 5 seconds, 15 seconds load value).

processes The total number of running processes since the last refresh. Of course, these processes are divided into running, sleeping, stopping, and many other types. The process and status display can be implemented by the interactive command t.

CPU states Displays the percentage of CPU time spent in user mode, system mode, priority process (only for negative considerations), and idleness. The time consumed by the priority process is also included in the time of the user and the system, so the total percentage will be greater than 100%.

Copyright © Windows knowledge All Rights Reserved