Skip to content

Instantly share code, notes, and snippets.

@copyleftdev
Created May 25, 2026 20:43
Show Gist options
  • Select an option

  • Save copyleftdev/29ac6ba73b17a36cbca2023c17764ddb to your computer and use it in GitHub Desktop.

Select an option

Save copyleftdev/29ac6ba73b17a36cbca2023c17764ddb to your computer and use it in GitHub Desktop.
watch — monitor any command output on a repeating interval
# 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