System administration

Linux top command

View a live, interactive summary of processes and resource use.

Availability: Common Linux commands; shell built-ins and external implementations may differ by distribution.中文

Syntax

top [OPTION]...

Examples

Interactively view system and process activity.

top

Capture one batch update and show its first lines.

top -b -n 1 | head -n 20

Parameters, options and clauses

Option / clauseDescription
-b, --batchRun in batch mode for scripts or redirection.
-n N, --iterations=NSet the number of updates before exit.
-d SECONDS, --delay=SECONDSSet the refresh delay.
-p PIDLISTMonitor selected process IDs.
-u USERShow processes owned by USER.
-HShow individual threads.
Safety note

Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.

Official reference ↗Back to directory