Linux top-statistics area

Source: Internet
Author: User
Tags superuser permission

The top five lines are the overall statistics of the system.

The first line is the task queue information, which is the same as the execution result of the uptime command. The content is as follows:

Top-15:09:51 up 17 days, 4 Users, load average: 1.09, 3.39, 4.76

15:09:51Current Time
Up 17 days, 3: 38System running time, in the format of minutes
4 UsersCurrent Login User count
Load average: 1.09, 3.39, 4.76System load, that is, the average length of the task queue.
The three values are the average values from 1 minute, 5 minutes, and 15 minutes ago to the present.

Second and Third, information about the process and CPU. When multiple CPUs exist, the content may exceed two rows. The content is as follows:

Task: 115 total, 1 running, 114 sleeping, 0 stopped, 0 zombie
CPU (s): 16.1% us, 2.0% Sy, 0.0% Ni, 79.5% ID, 1.4% wa, 0.0% hi, 1.0% Si

Tasks: 115 totalProcess count
1 runningNumber of Running Processes
114 sleepingSleep process count
0 stoppedNumber of stopped Processes
0 zombieNumber of zombie Processes
CPU (s): 16.1% usCPU usage percentage of user space
2.0% SYCPU usage of kernel space
0.0% NiCPU usage percentage of processes that have changed their priorities in the process space
79.5% IDIdle CPU percentage
1.4% waPercentage of CPU time waiting for Input and Output
0.0% hi
0.0% Si

Memory information of the last two behaviors. The content is as follows:

Mem: 8169876 k total, 7686472 K used, 483404 K free, 35272 K Buffers
Swap: 4096532 k total, 160 K used, 4096372 K free, 2477532 K cached

Mem: 8169876 ktotalTotal physical memory
7686472 K usedTotal physical memory used
483404 K freeTotal idle memory
35272 K BuffersKernel CacheMemory size
Swap: 4096532 k totalTotal number of swap partitions
160 K usedTotal number of swap zones used
4096372 K freeTotal number of idle swap Areas
The total number of swap areas of the 2477532 K cached buffer.

The content in the memory is swapped out to the swap zone and then into the memory, but the used swap zone has not been overwritten,
This value indicates the size of the SWAp zone where the content already exists in the memory.
When the corresponding memory is swapped out again, you do not have to write data to the swap zone.

Linux top-process information area

The details of each process are displayed at the bottom of the statistics area. First, let's take a look at the meaning of each column.

PID user PR Ni virt res shr s % CPU % mem time + command

Serial Number Column name meaning
PID process ID
Ppid parent process ID
Ruser realusername
User ID of the UID process owner
User: User Name of the process owner
Group Name of the group process owner
The terminal name of the TTY startup process. Processes not started from the terminal are displayed?
PR priority
Ninice value. A negative value indicates a high priority, and a positive value indicates a low priority.
P indicates the last CPU used, which is only meaningful in multiple CPU environments.
% Percentage of CPU time used since the last CPU update to the present
Total CPU time used by the time process, in seconds
Time + total CPU time used by the process, in the unit of 1/100 seconds
% Mem percentage of physical memory used by the Process
Total virtual memory used by the virt process, in KB. Virt = swap + Res
The swap size in the virtual memory used by the SWAp process, in KB.
The size of the physical memory used by the res process, Not swapped out, in KB. Res = code + Data
Physical memory occupied by code executable code, in KB
Physical memory occupied by parts other than the data executable code (Data Segment + stack), in KB
Size of SHR shared memory, in KB
Number of nflt page errors
The number of modified pages that the last time the data is written to the present.

S Process status.
D = uninterrupted sleep
R = run
S = sleep
T = tracking/stopping
Z = zombie Process

Command command name/command line
If the process is sleep, wchan displays the system function name in sleep.
Flags task flag. For more information, see sched. h.

Linux top-Shortcut Keys

By default, only important PID, user, PR, Ni, virt, res, SHR, S, % CPU, % MEM, time +, and command columns are displayed. You can use the shortcut keys below to change the display content.

Change display content
PassF keyYou can select the displayed content. Press F to display the column list. Press A-Z to display or hide the corresponding column, and press enter to confirm.

PressO keyYou can change the Column Display sequence. A lower-case a-Z can move the corresponding column to the right, while an upper-case A-Z can move the corresponding column to the left. Press enter.

Press the f or O key in upper case, and then press a-Z to sort the process according to the corresponding column. The uppercase r key can reverse the current sorting.

Linux top-command functions

Displays the current process and other conditions of the system. Top is a dynamic display process, which allows you to refresh the current state by pressing the buttons. if you execute this command on the foreground, it excludes the foreground until the user terminates the program. more accurately, the top command provides real-time monitoring of the status of the system processor. it displays the list of CPU-sensitive tasks in the system. this command can be used by CPU. the memory usage and execution time are used to sort tasks. Many features of this command can be set through interactive commands or in a custom file.

Linux top-Environment

In Linux.

Linux top-usage format

Top [-] [d] [p] [Q] [C] [C] [s] [s] [N]

Parameter description

D. Specify the interval between two screen information refreshes. Of course, you can use the S interactive command to change it.
P only monitors the status of a process by specifying the monitoring process ID.
Q This option will refresh top without any delay. If the caller has the superuser permission, top runs with the highest possible priority.
S indicates the accumulative mode.
S enables the TOP command to run in safe mode. This removes the potential danger of interactive commands.
I so that top does not show any idle or dead processes.
C. display the entire command line, not just the command name.

Linux top-interactive commands

The following describes some interactive commands that can be used during TOP command execution. From the perspective of usage, mastering these commands is more important than mastering the options. These commands are single-letter. If the s option is used in the command line option, some of these commands may be blocked.

CTRL + l erase and override the screen
H or? The help screen is displayed, and some brief command summary is provided.
K. terminate a process. The system prompts the user to enter the PID of the process to be terminated and the signal to be sent to the process. Generally, 15 signals can be used to terminate a process. If the process cannot end normally, use signal 9 to forcibly end the process. The default value is signal 15. This command is blocked in security mode.
I ignore idle and dead processes. This is a switch-on command.
Q: exit the program.
R reschedules the priority of a process. The system prompts the user to enter the process PID to be changed and the process priority value to be set. Entering a positive value will lower the priority, and vice versa will give the process a higher priority. The default value is 10.
S switches to the accumulative mode.
S changes the delay time between two refreshes. The system prompts the user to enter a new time in seconds. If there is a decimal number, it is converted to Ms. If the input value is 0, the system will be refreshed continuously. The default value is 5 s. It should be noted that if the setting is too small, it is likely to cause constant refresh, so it is too late to see the display, and the system load will increase significantly.
F or F: add or delete a project from the current display.
O or O changes the order of projects displayed.
L switching displays average load and startup time information.
The m switch displays the memory information.
T Switch displays the process and CPU status information.
C switch to display the command name and complete command line.
M is sorted Based on the resident memory size.
P is sorted by CPU usage percentage.
T is sorted by time/accumulative time.
W write the current settings ~ /. Toprc file. This is a recommended method for writing top configuration files.

Linux top-References


Source of the original article (Click here)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.