Problem Statement
How can you monitor a specific process continuously?
Explanation
Use watch with ps or pgrep to refresh process information at regular intervals.
This helps monitor memory usage or uptime of critical processes.
Code Solution
SolutionRead Only
watch -n 2 'ps -C nginx -o pid,cmd,%mem,%cpu'
Practice Sets
This question appears in the following practice sets: