Top command usage

Source: Internet
Author: User

Top command usage

The top command can be used to conveniently observe the information of processes running in the current system, and perform operations such as changing the priority of processes, changing sorting rules, and exporting status information during running, very convenient.

1. Main options

-D: the number of seconds to be followed, and the number of seconds to update the status. The default value is 5 seconds.
-B: Run top in batches. Usually, the top output is redirected to the file through redirection.
-N: used in combination with-B to run top times
-P: PID of the observed process

2. Key commands that can be used during top execution:

? : Display in top, you can enter the key command
P: sorted by CPU utilization;
M: Display by memory utilization;
N: sort by PID!
T: The cpu time accumulation (TIME +) used by the process is sorted.
K: Give a PID a signal (signal)
R: specify a nice value for a PID.
Q: Exit top.

3. Example

$ Top-d 2 // update the running status every 2 seconds

$ Top-B-n 2> ~ /Tmp/top.txt // export the status information of two running tasks to a file.

$ Top-d 2-p 1425 // updates the running status of the specified process every 2 seconds

Linux top commands

Linux top commands

Linux top commands for monitoring and diagnosis tools

Top command causes system load increase

Practical top Command

Why does Linux's htop command win the top command?

Use the most powerful process monitor htop in Ubuntu

This article permanently updates the link address:

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.