Linux Command Cheat Sheet/Run a command repeatedly

Refresh output at an interval.

Section: Performance Monitoring and Troubleshooting

Run a command repeatedly

bash
bash
watch -n 2 'df -h && echo && free -h'
Explanation

Great for observing changing state without rerunning commands manually.

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 Performance Monitoring and Troubleshooting
Show how the shell resolves a command
Reveal whether a name is an alias, builtin, function, or file.
OpenIn sheetbash1 tag match
Build command lines from stdin
Pass stdin items as arguments to another command.
OpenIn sheetbash1 tag match
Search shell history
Filter previous shell commands.
OpenIn sheetbash1 tag match
Strip directory and suffix from path
Return the last path component.
OpenIn sheetbash1 tag match
Get directory portion of path
Return the parent directory of a path.
OpenIn sheetbash1 tag match
Print working directory
Show the current absolute path.