I. Description of the Order
The top command monitors the operating status of the system in real time, and can be sorted by CPU, memory, and execution time, while the top command can be displayed via interactive commands, and the top command can be used to view the instant active.
Second, parameter description
- -B: Batch mode runs. Typically used to send the results of the top output to another program or to a file
- -C: Displays the command line that performs the task
- -D: Set delay time
- -H: Help
- -H: Displays the thread. When this setting is turned on, all threads generated by the process are displayed
- -I: Show idle Processes
- -N: Number of executions. Commonly used with-B
- -U: Monitor specified user-related processes
- -U: Monitor specified user-related processes
- -P: monitors the specified process. When multiple processes are monitored, the process IDs are separated by commas. This option can only be used at the command line
- -S: Safe mode operation
- -S: Cumulative time mode
- -V: Displays the top version and then exits
- -M: Automatic display of memory units (k/m/g)
Third, top interactive command
1. Global command
- Enter, Space: Refresh display information
- ? or h: Help
- =: Remove the limit displayed for all tasks
- A: Alternate display mode toggle
- B: Bold Display Toggle
- D or S: Change the interface refresh time interval
- G: Select a different window/field group
- I:irix or Solaris mode switching
- U or u: monitor specified user-related processes
- K: End Process
- Q: Exit Top
- R: Re-set the nice value of the process
- W: Store Current settings
- Z: Change the color template
2. Summary Area Command
- L: Average load and system run time display switch
- M: Memory and swap space usage display switch
- T: Current task and CPU status display switch
- 1: summary displays CPU status or shows each CPU state separately
3. Mission Area Command
- Appearance style
- ? B: bold/Inverse color to display highlighted rows/columns. Control the display style for x and y interactive commands
- X: Highlight sorted columns
- ? Y: Highlight a running task
- ? Z: Color/black and white display.
- Show content
- ? C: Command line or process name for task execution
- ? F or O: Add and remove process information fields and adjust process information field display order
- ? H: Show Threads
- ? S: Time Accumulation Mode
- ? U: Monitor specified user-related processes
- The number of tasks displayed
- ? I: Show the Idle Process
- ? N or #: Sets the maximum number of tasks to display
- Task sequencing (SHIFT+F)
- ? M: Sort by Memory utilization
- ? N: Sort by PID
- ? P: Sort by CPU usage
- ? T: Sort by time+
- ? <: Sort by adjacent columns to the left of the current sort field
- ? : Sort by the adjacent column to the right of the current sort field
- ? F or O: Select sort field
- ? R: Reverse Sort
Iv. Explanation of parameters
1, the first line is the task queue information, with the uptime command, its contents are explained as follows:
21:59:09 |
Current time |
Up 11:21 |
System run time, in the format: hours: Minutes |
2 users |
Number of currently logged on users |
Load average:0.05,0.01,0.01 |
System load, that is, the average length of the task queue, three values are: 1 minutes, 5 minutes, 15 minutes ago to the present average |
2, 23rd behavior process and CPU information, when there are multiple CPUs, these content may be more than two lines, the content is as follows:
task:113 Total |
Total number of processes |
1 Running |
Number of processes that are running |
Sleeping |
Number of dormant processes |
0 stoped |
Number of processes stopped |
0 Zombie |
Number of zombie processes |
Cpu (s): 0.3%us |
Percentage of CPU time consumed by user processes |
0.0%sy |
Percentage of CPU time consumed by system processes |
0.0%ni |
Percentage of CPU time for processes that have changed priority within user process space |
99.7%id |
CPU idle state percent of time |
0.0%wa |
Percentage of CPU time that I/O waits |
0.0%hi |
The total amount of time that the CPU spends on hard interrupts |
0.0%si |
The total amount of time the CPU spends on soft interrupts |
0.0%st |
CPU service steal time spent on soft interrupts |
3.45th Behavior Memory Information
mem:1030616k Total |
Total Physical Memory |
698152k used |
Total amount of physical memory used |
332464k Free |
Amount of free physical memory |
31392k buffers |
Total memory used as kernel cache |
swap:2064376k Total |
Total Swap partition |
0k used |
Swapped partitions that have been used |
2064376k Free |
Idle swap partition |
117716k Cached |
The total number of buffered swap partitions. |
4. Process information
Pid |
Process ID |
PPID |
Parent Process ID |
Ruser |
Real User Name |
Uid |
User ID of the process owner |
USER |
User name of the process owner |
GROUP |
Group Name of Process owner |
Tty |
The terminal name of the startup process, and the process that is not started from the terminal is displayed as? |
PR |
Priority level |
NI |
Nice value, negative indicates high priority, positive values indicate low priority |
P |
Last CPU used, only meaningful in multi-CPU environment |
%cpu |
CPU time consumption percentage last updated to current |
Time |
Total CPU time used by the process, in seconds |
time+ |
Total CPU time used by the process, unit 1% seconds |
%MEM |
Percentage of physical memory used by the process |
VIRT |
The total amount of virtual memory used by the process, in kilobytes. Virt=swap+res |
SWAP |
The size of the process used in virtual memory, swapped out, in kilobytes |
Res |
The size, in kilobytes, of the physical memory that the process used and was not swapped out. Res=code+data |
CODE |
The amount of physical memory the executable code occupies, in kilobytes |
DATA |
The amount of physical memory occupied by parts other than executable code (data segment + stack) |
Shr |
Shared memory size, in kilobytes |
Nflt |
Number of page faults |
Nfrt |
Last write to now, number of pages modified |
S |
Process Status: D: Non-disruptive sleep status R: Run S: Sleep T: Track/Stop Z: Zombie Process |
COMMAND |
Command name/command line |
Wchan |
If the process is sleeping, the system function name in sleep is displayed |
Flags |
Task Flag, reference sched.h |
- Only the more important columns are displayed by default: PID, USER, PR, NI, VIRT, RES, SHR, S,%cpu,%MEM, time+, COMMAND
- You can change the display by using the following shortcut keys:
- Change the display by the F key to select what to display (press the F key to display a list of columns, press A-Z to show or hide the corresponding column, and then press ENTER to confirm)
- Press the O key to change the order in which the columns are displayed (A-Z in lowercase can move the corresponding column to the right, while the uppercase A-Z can move the corresponding column to the left, and then press ENTER to determine)
- Press the uppercase F or O key, and then press A-Z to sort the process by the appropriate column, while the uppercase R key reverses the current sort.
==>top of Linux monitoring commands