Skip to main content

Command referencetop

top command (Linux / bash / sh / zsh)

Linuxbashshzshprocessbeginner

What it does

Monitor processes and system resource use in real time. When people search for the top command linux monitoring, they usually want top's everyday flags, safe examples, and how it differs from related tools. Below you'll find syntax, options, and copyable examples for Bash/sh/zsh.

Monitor processes and system resource use in real time.

Syntax

top [OPTION]...

Common options

Flag / optionMeaning
-p PIDMonitor only selected process IDs.
-u USERShow processes for one user.
-d SECONDSSet the refresh delay.
-bUse batch mode for redirected output.

Practical examples

Open monitor

top

Starts the interactive process display.

Watch a process

top -p 4242

Limits updates to PID 4242.

Capture snapshot

top -b -n 1 > top.txt

Writes one noninteractive snapshot.

Common mistakes

  • Reading load average as CPU percentage; they measure different things.
  • Redirecting interactive top without enabling batch mode.

FAQ

What does top do in Linux?

Monitor processes and system resource use in real time.

How do I use top from the terminal?

Start with `top [OPTION]...`, then choose only the options needed for the task.

What is a practical top example?

Try `top` — Starts the interactive process display.

Can I use top in a shell script?

Yes. top works in Bash, sh, and Zsh, but scripts should handle quoting, errors, and command output explicitly.

Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.