Run a command with a time limit
medium risk
Sends a signal (TERM by default) after a duration; add -k to follow up with KILL.
| Flag | Meaning |
|---|---|
-s | Signal to send |
-k | Send KILL after a grace period |
timeout 30 curl -s https://example.comFail after 30 s · explain & risk-check →timeout -k 5 60 ./job.shTERM at 60s, KILL 5s later · explain & risk-check →Reference text is hand-written and may be incomplete — check man timeout for your version. Test destructive commands on a non-production system first.