[One question per day] talk about the features and usage of the Linux top command

Source: Internet
Author: User

The role of the top command

Used to view the resource usage of the process, such as you write a program, want to see how much it occupies the CPU, how much memory, whether the machine is overloaded, top can help you

Usage

Enter top directly, this is the screen will show some dynamic changes in the refresh period is 1s, if you want to change the refresh period, use the-D (delay) parameter, such as: top -d 3 indicates 3s refresh once

I am currently using Ulric account to log in, I just want to see Ulric start all the process of the situation: top -u ulric
I just want to see the situation of a certain number of PID corresponding processes:top -p pid1, pid2, pid3

The refresh process responds to a number of keystrokes, such as:
M Sort by memory footprint
P Sort by CPU consumption
T Sort by time+ occupancy
K prompts you to enter a PID, which will be killed after the input
U prompt you to enter a user name, for example, I input Ulric, will show only the ulric corresponding process situation
C Display command complete commands, click again, back to the original appearance
Q Exit Top

The role of each field
PID//Process Piduser    //Process Owner PR  //process priority, smaller priority executed NI  //Nice value virt///    process occupied virtual memory RES//process occupied physical memory SHR// The process uses the shared memory s   //process state, S for hibernation, R for Running;z, and N for the process with a negative value    of%CPU//process-occupied CPU usage%mem    // The amount of physical memory that the process consumes and the percentage of total memory time+   //The total CPU time that is consumed after the process is started, that is, the cumulative value of CPU usage command//process start name

More it interview questions please pay attention to public number: It_mianshiti

[One question per day] talk about the features and usage of the Linux top 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.