Linux TOP Command details)

Source: Internet
Author: User

Linux top commands)
The basic functions of the top command and ps command are the same, displaying the current process of the system and other conditions. However, the top command is a dynamic display process, that is, you can press the key to continuously refresh the current state. Such? The front-end executes this command, and it will exclusively occupy the front-end 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-most "sensitive" tasks in the system. This command can sort tasks by CPU usage, memory usage, and execution time. Many features of this command can be set through interactive commands or in a custom file. The command parameters and interactive commands will be described separately in the subsequent sections.

TOP command syntax:
Top [-] [d delay] [Q] [C] [s] [s] [I]

D. Specify the interval between two screen information refreshes. Of course, you can use the S interactive command to change it.
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. (The command column of the Process displays the corresponding command line or command name of the process)

Detailed description of TOP command results:

The top command displays many items. The default value is to update every 5 seconds. The displayed items are:

15:06:57 up 129 days, 5 Users, load average: 1.21, 1.20, 1.25

Uptime indicates the system startup time, running time, and three average load values (the load values of the last 1 second, 5 seconds, and 15 seconds ).

222 processes: 219 sleeping, 2 running, 1 zombie, 0 stopped

Total number of processes running since the last refresh. These processes are divided into running, sleep, and stopped processes.

CPU states: CPU user nice system IRQ softirq iowait idle
Total 0.9% 0.0% 27.4% 0.0% 0.0% 0.2% 71.2%
Cpu00 1.9% 0.0% 19.4% 0.0% 0.0% 0.0%
Cpu01 0.0% 0.0% 33.0% 0.0% 0.0% 0.0%
Cpu02 1.9% 0.0% 22.3% 0.0% 0.0% 0.9% 74.7%
Cpu03 0.0% 0.0% 35.2% 0.0% 0.0% 0.0%

CPU States displays the percentage of CPU time used in various situations, such as user mode, system mode, priority process (only those with a negative priority), and idle. The time consumed by the priority process is also included in the user and system time, so the total percentage will be greater than 100%.

Mem: 16214336 k av, 15682832 K used, 531504 K free, 0 K shrd, 215016 K buff
10896844 k actv, 3379680 K in_d, 446432 K in_c

Mem memory usage statistics, including the total available memory, idle memory, used memory, shared memory and cache memory.

Swap: 10482404 k av, 0 K used, 10482404 K free 14856500 K cached

Swap swap space statistics, including the total swap space, available swap space, and used swap space.

PID user pri Ni size RSS share stat % CPU % mem time CPU command

27869 root 25 0 460 m 460 m 455 M r 25.0 2.9 12559 M 1 vmware-vmx
31819 root 16 0 6016 6016 5048 s 1.6 0.0 17573 M 2 magicdev
27837 root 15-10 460 m 460 m 455 m s <0.7 2.9 1328 M 0 vmware-vmx
27868 root 15-10 460 m 460 m 455 m s <0.3 2.9 644: 35 3 vmware-vmx

Pid id of each process. Ppid: the parent process ID of each process. UID: The UID of each process owner.

User: the username of each process owner.

The priority of each process in PRI.

The priority of the process.

Size: the code size of the process, the data size, and the total size of the stack space. The Unit is kb.

Tsize: the code size of the process. This is a strange value for Kernel processes.

Dsize data and stack size.

TRS text resident size.

D. The page project marked as "not clean.

The size of the library page used by Lib. It does not work for the elf process.

Res the total number of physical memory occupied by the process, in KB.

Share the amount of memory used by the process.

Stat the status of the process. S indicates the sleep state, D indicates the non-interrupted sleep state, r indicates the running state, Z indicates the frozen state, and t indicates the stopped or tracked state.

Time the total CPU time occupied by the process since it was started. If you enter the accumulative mode, the time also includes the time occupied by the sub-process of the process. The title is changed to ctime.

% CPU the percentage of CPU time and total time occupied by the process since the last refresh.

% Mem the percentage of physical memory occupied by the process to the total memory.

Command indicates the command name of the process. If one line does not show any more, the command is intercepted. The process in the memory has a complete command line.

Top interactive Command Options

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.

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 m s. 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.
 

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: info-contact@alibabacloud.com 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.