Linux View CPU and memory (i)----top command __linux

Source: Internet
Author: User
Tags memory usage cpu usage
Introduction to the top commandDuring system maintenance, you may need to look at the CPU usage at any time, and analyze the system condition according to the corresponding information. In CentOS, you can view CPU usage through the top command. When you run the top command, the CPU usage status is displayed in full screen and in a conversational mode-with the command based on top, you can control how the display is displayed, and so on. The command to exit Top is Q (hit Q key once in top run). The top command is a commonly used performance analysis tool under Linux to display the resource consumption status of each process in real time, similar to the Task Manager of Windows.
You can view the contents of the%mem directly after you use the top command. You can choose to view by process or by user.
1, according to the user viewFor example, to view the root user's process memory usage:
2. View by ProcessFor example, to view 6111 process memory usage:

For example, view 6111 and 10830 process memory usage:

Top Information Detailed the first part--The top system Information Bar first line (top)"17:14:26" is the current moment of the system;
"Days, 23:04" for the system after the start of the current operation time;
"2 users" for the current user login to the system, or, more specifically, the number of users login to the user's terminal-the same user at the same time to the system more than one terminal connection will be considered as multiple users connected to the system, where the number of users will also appear as the number of terminals;
"Load average" is the average of the current system load, the following three values are 1 minutes ago, 5 minutes ago, 15 minutes before the average process, the general can be considered that the number of CPUs, the CPU will be more laborious load the current system contains processes;
second Line (Tasks)"2 Total" is the current number of system processes;
"0 Running" is the number of processes currently running;
"2 Sleeping" is the number of processes currently in the waiting state;
"0 stoped" is the number of system processes stopped;
"0 Zombie" for the number of recovered processes;
Third Line (Cpus)The current utilization rate of CPU is indicated respectively.
Line Fourth (MEM)Represents the total amount of memory, current usage, amount of idle memory, and the amount of RAM used in the buffer;
Line Fifth (Swap)Represents a category with line fourth (MEM), but this reflects the usage of swap partitions (swap). Typically, swap partitions (swap) are used frequently, and are considered to be the result of insufficient physical memory.
Part II-Internal command prompt bar in the middle sectionThe top command allows you to control how the process is displayed through the top's internal commands. The internal command follows the following table:
S
-Change the frequency of the screen update
L-The representation of the first line top information on the first section is closed or opened
T-closes or opens the first part the second line of Tasks and third line Cpus information representation
M-to close or open the first section the representation of the four-line Mem and fifth-line Swap information
N-Arranges the list of processes in the order of the PID size (Part III)
P-Arranges the list of processes in the order of CPU usage (Part III)
M-Arranges the list of processes in the Order of Memory occupancy (Part III)
H-Show help
N-Sets the number of processes displayed in the process list
Q-Exit Top
S-
Change the screen update cycle
Part III-the process list bar in the bottom sectionThe PID-Differentiated process list updates periodically according to the set of screens. You can control how this is displayed through the top internal command

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.