Re-run a command periodically for live monitoring.
Section: Backgrounding and Daemonization
Repeat command with watch
bash
bash
watch -n 2 "ps -eo pid,comm,%cpu --sort=-%cpu | head"Explanation
Re-run a command periodically for live monitoring.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Backgrounding and Daemonization
Run command immune to hangups
Keep a process running after the shell exits.
Start in a new session
Start a process in a new session detached from the terminal.