Stop a command if it runs too long.
Section: Automation Recipes
Bound command runtime
bash
bash
timeout 30s bash -lc 'long_running_job'Explanation
Very useful in automation, though timeout is an external command.
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 Automation Recipes
Run two jobs in parallel and wait
Start jobs in background and wait for both.
Generate config with variable expansion
Create small config files from shell variables.