Linux under top command learning

Source: Internet
Author: User

Website: http://www.cnblogs.com/qiwenhui/articles/4262044.html

1. Command-Line options:

1.1-b: Batch processing mode

The-B option starts the top command in batch mode. This is useful when you want to save the output in a file.


1.2-C: Command/program name trigger:

As the command discussed above, this option is displayed in the status displayed (whether full path is displayed) in the last remembered program/command.


1.3-d: Setting the delay interval

Sets the display interval for top (in seconds). Like what.


$ top-d 1

The top will be started at a refresh interval of 1 seconds.


1.4-i: Toggle Show Idle Process

This option sets the last remembered opposite ' I ' State of the top command.


1.5-n: Set Number of iterations

With the-n option, you can set the number of times the top exits the previous iteration.


$ top-n 3

Will exit 3 times after the output is refreshed.


1.6-P: monitoring a specific PID

You can monitor the specified PID with the-P option. A PID value of 0 will be used as the PID of the top command itself.


1.7-u or-u: Username or UID

You can use these options to browse the processes for a particular user. The user name or UID can be specified in the options. The-P,-U, and-u options are mutually exclusive and can only be used with one of these options. When you try to use these options together, you get an error:

$ top-p 28453-u Raghu

Top:conflicting Process Selections (u/p/u)


#/usr/bin/bash

RM Cpuinfo.log

Top-n35-b-d5 | Awk-f ', '/^cpu/{split ($4,a, "%");p rint a[1]} ' >> Cpuinfo.log


Linux under top command learning

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.