Monitor per-process CPU and memory use with periodic terminal updates and interactive controls.
Which command is appropriate?
top periodically refreshes process CPU and memory statistics and supports interactive sorting and signals.
Detailed explanation
topCorrect. top provides a continuously updated interactive process view.
Correct. top provides a continuously updated interactive process view.
pstreeIncorrect. pstree focuses on parent-child relationships.
Incorrect. pstree focuses on parent-child relationships.
uptimeIncorrect. uptime reports load and uptime once rather than per-process use.
Incorrect. uptime reports load and uptime once rather than per-process use.
killIncorrect. kill sends signals and does not monitor usage.
Incorrect. kill sends signals and does not monitor usage.
Try it yourself
An example you can run in a temporary verification environment.
top -b -n 1 | headExpected result
batch modeで1回取得したsystem・process統計Key points
- top
- Live monitoring
- CPU usage
Notes
- Environment: procps-ng系topをbatch modeで1回だけ実行
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.