timeout
Run a command with a time limit, killing it if it exceeds the duration.
Synopsis
timeout [OPTION]... DURATION COMMAND [ARG]...
Examples
timeout 30 curl https://example.com
timeout -k 5 60 ./long-task.sh
timeout -s KILL 10 ping 8.8.8.8
Common options
| Flag | Description |
|---|---|
| -s | Signal to send on timeout (default TERM) |
| -k | Send KILL signal after grace period |
| --foreground | Allow command to read from TTY |
| -v | Verbose — diagnose to stderr on timeout |
About timeout
The `timeout` command run a command with a time limit, killing it if it exceeds the duration. Process management commands let you monitor, control, and schedule running processes.
Linux is a multitasking operating system, and understanding how to list processes, send signals, adjust priorities, and manage background jobs is vital for system administration and debugging performance issues. The command accepts 4 commonly used flags shown above, though the full set of options is available in the man page (`man timeout`).
The 3 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.
Related commands
More Process Management Commands
Other commands in the Process Management category