Created
May 25, 2026 20:43
-
-
Save copyleftdev/29ac6ba73b17a36cbca2023c17764ddb to your computer and use it in GitHub Desktop.
watch — monitor any command output on a repeating interval
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # watch — repeat a command every N seconds with a live-updating view | |
| # Basic: refresh every 2 seconds | |
| watch -n2 <command> | |
| # Highlight what changed since last refresh | |
| watch -n1 -d ls -lh outputs/ | |
| # Monitor GPU memory during inference | |
| watch -n1 nvidia-smi --query-gpu=memory.used,memory.free --format=csv | |
| # Monitor a queue draining | |
| watch -n1 'ls queue/ | wc -l; echo "---"; ls queue/' | |
| # Machine-readable output (no TUI chrome) | |
| watch --no-title -n1 date | tee timestamps.log | |
| # Replace ad-hoc while loops: | |
| # while true; do cmd; sleep N; done → watch -n N cmd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment