top
ProcessesBeginner In real LinuxLive view of processes and resource usage
Name: top: shows the top resource consumers
This command needs a real Linux system; you can practise it in real Linux mode.
Description
top shows a live system summary and process list, refreshing every 3 seconds. The header has uptime, load averages, task counts and CPU and memory usage; the list below is sorted by CPU use.
It is interactive: P sorts by CPU, M by memory, k kills a process, 1 shows each core, q quits.
Syntax
top [OPTION]...Common options
| -u USER | Only a user's processes |
| -p PID | Watch only these processes |
| -d SECONDS | Refresh interval (3 seconds by default) |
| -o FIELD | Sort by a column, e.g. -o %MEM |
| -b | Batch mode: plain text you can redirect (with -n) |
| -n NUM | Quit after NUM refreshes |
| P / M | (inside top) Sort by CPU / memory |
| 1 | Show each CPU |
| c | Show the full command line |
| k | (inside top) Kill a process |
| q | Quit |