System and processes

The top command

Shows a snapshot of every process sorted by usage, with the load and memory summary on top.

Syntax

top

Most useful options

-u usuarioOnly that user's processes
-n NNumber of refreshes
qOn a real Linux, q quits top

Copy-ready examples

$ topProcess snapshot
$ top -u rootOnly root's

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • Here it is a simulated, fixed view; on a real Linux it refreshes itself and you quit with q.
  • A CPU at 100% is not bad by itself: check whether there are processes in state R (running).

Related commands

FAQ

How do I sort by memory?

In real top, with M; P sorts by CPU.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course