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.
pstreeIncorrect. pstree focuses on parent-child relationships.
uptimeIncorrect. uptime reports load and uptime once rather than per-process use.
killIncorrect. 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回だけ実行
- Use a disposable process or test shell when checking lifecycle commands.
- Exact output and option names can vary slightly by distribution and tool version.
Foundation review
Place the operation
top can sort and refresh process data; a batch invocation is useful when a single report is needed for logs.
Check the side effect
Use a controlled sampling interval so the monitoring command does not distort the workload being observed.