top Linux Command
Displays an interactive, real-time view of system processes and resource usage.
What does top do?
Displays an interactive, real-time view of system processes and resource usage.
Syntax
topPractical example
topQuestions about top
How do I quit top?
Press `q` to quit top and return to the command prompt. You can also press Ctrl+C if top is in interactive mode.
How do I sort processes by CPU usage?
Press `P` (uppercase) to sort by CPU usage. Press `M` to sort by memory usage. These are toggles that change the sort order.
How do I kill a process in top?
Press `k` and enter the PID of the process you want to kill. You can also send a specific signal by typing the signal number first.
How do I see all processes by all users?
Press `a` to toggle the current window's sort field. Press `u` and enter a username to filter by user. Press `Shift+A` for all-process view.
How do I change the update interval?
Press `d` and enter a new interval in seconds (e.g., `d 2` for 2-second updates). Default is usually 3 seconds.
What do the load averages mean in top?
Load averages show the 1, 5, and 15-minute averages of processes in runnable or uninterruptible state. A value equal to CPU count means fully utilized.
How do I see only my processes in top?
Press `u` and enter your username to filter processes by your user only. This removes clutter from other users' processes.
How do I save top configuration?
Press `W` to save your current configuration (sort order, display settings) to ~/.toprc. It will be loaded automatically next time.
Related Process Commands
psReports a snapshot of current running processes with their PIDs.
htopEnhanced, more user-friendly version of top with color and mouse support.
pgrepSearches for processes by name and returns their PIDs.
killSends a signal to terminate a process by its PID.
nohupRuns a command that keeps running even after the terminal session is closed.
killallKills all processes matching a given name.