cmdxray / commands / timeout

What does timeout do?

run a command, killing it if it runs longer than a time limit.

▸ Explain your own timeout command →

timeout examples, explained

$ timeout 10 ./run.sh

  • timeoutrun a command, killing it if it runs longer than a time limit
  • 10an argument passed to the command
  • ./run.shan argument passed to the command

$ timeout -s KILL 30 python job.py

  • timeoutrun a command, killing it if it runs longer than a time limit
  • -ssend this signal instead of SIGTERM when time runs out
  • KILLvalue for -s
  • 30an argument passed to the command
  • pythonan argument passed to the command
  • job.pyan argument passed to the command

$ timeout -k 5 60 make

  • timeoutrun a command, killing it if it runs longer than a time limit
  • -kif still alive after this long, follow up with SIGKILL
  • 5value for -k
  • 60an argument passed to the command
  • makean argument passed to the command

timeout flags & options

-ssend this signal instead of SIGTERM when time runs out
-kif still alive after this long, follow up with SIGKILL
--signalsend this signal instead of SIGTERM when time runs out
--kill-afterif still alive after this long, follow up with SIGKILL
--preserve-statusexit with the command's own status, not 124
--foregroundlet the command read from the terminal (don't isolate it)
-vverbose — announce when the command is being signalled
--verboseverbose — announce when the command is being signalled

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.