Read and Use `top` on Linux
top is a standard Linux tool for viewing system load and processes in real time. It is useful when diagnosing high CPU use, memory pressure, runaway processes, or general server load.
Start top
topThe display has a system summary at the top and a process table below it.
Read the System Summary
Common fields include:
- uptime — how long the system has been running;
- load average — average runnable/uninterruptible work over roughly 1, 5, and 15 minutes;
- tasks — running, sleeping, stopped, and zombie processes;
- CPU — time spent in user, system, idle, I/O wait, and other states;
- memory and swap — total, free, used, and cache-related values.
A load average is not a CPU percentage. Interpret it relative to the number of logical CPUs and the type of workload.
Read the Process Table
Important columns commonly include:
PID— process ID;USER— owner;PR/NI— scheduling priority and nice value;VIRT— virtual address space;RES— resident memory currently held in RAM;%CPUand%MEM— resource usage;TIME+— accumulated CPU time;COMMAND— process name or command.
Useful Interactive Keys
Inside top:
Psorts by CPU usage;Msorts by memory usage;Tsorts by accumulated CPU time;kprompts for a PID and signal;rchanges a process nice value;dchanges the refresh delay;fselects displayed fields;hshows help;qquits.
Available keys can differ slightly between implementations, so the built-in help is authoritative for the installed version.
Save Configuration
Many procps-ng versions of top let you press W to write the current configuration to a user config file, commonly under ~/.config/procps/ or a legacy ~/.toprc location depending on the version.
Conclusion
top gives a fast real-time view of system and process activity. Learn the CPU, load, memory, and process columns first, then use its sorting and filtering controls to narrow down the source of resource problems.