top command

LINUX-Frequently used commands

top command Real-time display of running processes.
Syntax
top   [Option]
The top command displays the currently running processes in order of increasing CPU utilization.
The display will be updated in real time.
Enter "q" to exit.
Frequently used options
-d  <interval> Specify the interval to update in "ss.tt seconds".
-n <Number of times> Specify the number of times to repeat the display
-b Batch mode
The key operation is not accepted and execution continues until the number of times specified by "-n" or until it is killed by "CTRL+C".
Useful for saving top results to a file, for example.
-s  Operates in secure mode(Does not accept "d" etc. during startup )
-U <user>,
-u <user> 
Specify the user to monitor by name or ID
-p  <Process ID> Specify the process ID to monitor
You can specify more than one, as in "-p number -p number" or "-p number, number".(Spaces can be omitted)
-c  Toggle the COMMAND column (far right) to show the program name or the command line(After starting up, use "c" to switch)
-i  Toggles between showing and not showing idle processes that are not running(Switch with "i" after launch
-S   Specify the items to be used to sort the output(Default is CPU usage)
The names of the items that can be specified are confirmed by using "top -O
-w <Number of digits> Output width
Example: View file details.
$ su -  
Password:
#  top

PID Process ID
USER User name
PR Process priority
NI Process priority in nice values
VIRT Memory usage size (kb)
RES Actual memory usage size (kb)
SHR Shared memory size (kb)
S Process status
R:Operation
S:Sleep
D:Sleep (not available)
T:Stop in progress
Z:Zombies
%CPU CPU usage
%MEM Memory usage
TIME+ Process uptime
COMMAND Process commands
Copied title and URL