top - See resource usage

The top command provides a dynamic, real-time view of a running system and shows resource usage on a thread level. It can show, for example, CPU usage and detailed memory usage.

Syntax

See the top man page for the complete syntax and all options.

1  top?  -d  delay?  -n  iterations?  -p + , pid

Parameters

-b
Writes the output for each interval into a file.
-d
Specifies the delay time interval in seconds.
-n
Indicates that the maximum number of iterations top should produce before it ends.
-p
Limits the output to the specified processes.
In the running top program, use the F key to configure the displayed columns. Use the W key to write the current configuration to ~/.toprc This is the default directory.

Example

To collect 180 measurements with a one second frequency into a file, issue:
[root@system]#  top -b -d 1 -n 180 >top.log 2>&1