timeout
Run a command with a time limit. More information: https://www.gnu.org/software/coreutils/manual/html_node/timeout-invocation.html.
- Run
sleep 10and terminate it after 3 seconds:
timeout 3s sleep 10
- Send a signal to the command after the time limit expires (
TERMby default,kill -lto list all signals):
timeout
- Send verbose output to
stderrshowing signal sent upon timeout:
timeout
- Preserve the exit status of the command regardless of timing out:
timeout
- Send a forceful
KILLsignal after certain duration if the command ignores initial signal upon timeout:
timeout
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
