Linux top commands are sorted by memory usage and by CPU usage

Source: Internet
Author: User

P-process list in the order of CPU usage
M-sort the process list in the order of memory usage

During system maintenance, you may need to check the CPU usage at any time and analyze the system status based on the relevant information. In centos, you can use the top command to view CPU usage. After running the TOP Command, the CPU usage status will be displayed in full screen mode and in dialog mode-the top-based command can be used to control the display mode. The command to exit top is Q (Press Q once in top running ).
Enter "TOP" in the command line to start top. The full-screen dialog mode of top can be divided into three parts: system information, command input, and process list.
Part 1-System Information bar at the top:
The first line (top ):
"14:55:59" indicates the current system time;
"4 days," indicates the current operating time after the system is started;
"1 user" is the user currently logged on to the system, more specifically, the number of terminals that log on to a user-the number of terminals that a user connects to multiple terminals in the system at the same time is considered as multiple users connecting to the system, the number of users here will also be the number of terminals;
"Load average" is the average value of the current system load. The following three values are the average number of processes 1 minute ago, 5 minutes ago, and 15 minutes ago, respectively, generally, when this value exceeds the number of CPUs, the CPU will be overloaded with the processes contained in the current system;
Line 2 (tasks ):
"12 Total" indicates the total number of processes in the current system;
"1 running" indicates the number of processes currently running;
"11 sleeping" indicates the number of processes in the waiting status;
"0 stoped" indicates the number of stopped system processes;
"0 zombie" indicates the number of recovered processes;
Row 3 (CPUs ):
Indicates the current CPU usage;
Row 4 (MEM ):
Total memory, current usage, idle memory, and buffer memory respectively;
The fifth line (SWAP ):
Indicates that the category is the same as the fourth row (MEM), but this shows the usage of swap partition (SWAp. In general, swap partitions (SWAP) are frequently used and are considered to be caused by insufficient physical memory.
Part 2-Internal Command Prompt bar in the middle section:
You can use top's Internal commands to control the display mode of processes. The internal commands are as follows:
S-change the screen update frequency
L-Disable or enable the first line of top information in the first part.
T-Disable or enable the expression of the first part of the second line of tasks and the third line of CPUs Information
M-Disable or enable the expression of the first part of the fourth line of MEM and the fifth line of swap information
N-process list in the order of PID size
P-process list in the order of CPU usage
M-sort the process list in the order of memory usage
H-Show Help
N-set the number of processes displayed in the Process List
Q-exit top
S-change the screen update cycle
Part 3-process list at the bottom:
The process list differentiated by PID is regularly updated based on the set screen update time. You can use the top internal command to control the display mode.
In general, we maintain the server through remote monitoring, so that the local terminal of the server runs top in real time, which is one of the fast and convenient ways to monitor the server status locally on the server.

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.