top
Display and manage running processes
TLDR
Start top
$ top
Do not show any idle or zombie processes
$ top [[-i|--idle-toggle]]
Show only processes owned by given user
$ top [[-u|--filter-only-euser]] [username]
Sort processes by a field
$ top [[-o|--sort-override]] [field_name]
Show the individual threads of a given process
$ top [[-Hp|--threads-show --pid]] [process_id]
Show only the processes with the given PID(s), passed as a comma-separated list. (Normally you wouldn't know PIDs off hand. This example picks the PIDs from the process name)
$ top [[-p|--pid]] $(pgrep [[-d|--delimiter]] ',' [process_name])
Display help about interactive commands
$ <?>
SYNOPSIS
top [options]
PARAMETERS
-d SECS
Update interval in seconds
-n NUM
Number of iterations
-p PID
Monitor specific process
-u USER
Show processes for user
-b
Batch mode (for scripting)
-c
Show command line
-H
Show threads
-i
Ignore idle processes
DESCRIPTION
top provides a dynamic real-time view of running processes. It displays system summary information and a list of processes sorted by CPU usage or other criteria. top allows interactive process management and is essential for monitoring system performance.
CAVEATS
High refresh rates increase CPU usage. Default sorting by CPU can be changed. Consider htop for better interface.
INTERACTIVE KEYS
k - Kill process
r - Renice process
M - Sort by memory
P - Sort by CPU
1 - Show per-CPU stats
q - Quit


