timeout

Run a command with a time limit

medium risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
What it does

Sends a signal (TERM by default) after a duration; add -k to follow up with KILL.

Common flags
FlagMeaning
-sSignal to send
-kSend KILL after a grace period
Examples
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 →
Related
kill watch
Open the full explainer →More in Shell & Scripting

Reference text is hand-written and may be incomplete — check man timeout for your version. Test destructive commands on a non-production system first.