Master Linux ‘top’ Command: Real‑Time Process Monitoring Guide
This article explains how to use the Linux top command for real‑time system and process monitoring, covering its interface, statistical and process sections, interactive shortcuts, command‑line options, and internal commands to customize and sort the displayed information.
Statistical Information Area
The first five lines of top display overall system statistics. The first line shows the task queue information, similar to the output of the uptime command. The second and third lines provide CPU and process details, which may span multiple lines on multi‑CPU systems. The last two lines present memory information, including swap usage.
Process Information Area
Below the statistical section, top lists detailed information for each process. By default it shows important columns such as PID, USER, PR, NI, VIRT, RES, SHR, S, %CPU, %MEM, TIME+, and COMMAND.
Changing Display Content
Press f to select which columns to display; use the letters a‑z to toggle individual columns and press Enter to confirm. Press o to reorder columns; lowercase a‑z moves a column right, uppercase A‑Z moves it left, then confirm with Enter. Uppercase F or O followed by a‑z sorts processes by the chosen column, while R reverses the current sort order.
Command Usage
1. Usage format
2. Option explanations d: Set the delay between screen refreshes; can be changed interactively with the s command. p: Monitor only the process with the specified PID. q: Run top with no delay; if run as root, it uses the highest possible priority. S: Enable cumulative mode. s: Run top in safe mode, disabling potentially dangerous interactive commands. i: Hide idle or zombie processes. c: Show the full command line instead of just the command name.
Internal Interactive Commands
During a top session, several single‑letter commands can be used to control the display: h: Show a help screen with a brief summary of commands. k: Kill a process; you will be prompted for the PID and the signal (default 15, use 9 to force). i: Toggle ignoring idle and zombie processes. q: Quit top. r: Renice a process by providing its PID and the new priority value. S: Switch to cumulative mode. s: Change the delay between refreshes; entering 0 results in continuous refresh. f or F: Add or remove columns from the display. o or O: Change the order of displayed columns. l: Toggle display of load average and uptime. m: Toggle memory information. t: Toggle task and CPU state information. c: Toggle between command name and full command line. M: Sort by resident memory size. P: Sort by CPU usage percentage. T: Sort by time/cumulative time. W: Write the current configuration to ~/.toprc.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
