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