1 Answer
Answer:
- Its syntax is as follows.
timeout [OPTION] DURATION COMMAND [ARG]...
- to timeout a ping command after 5 seconds, you can run the following command.
# timeout 5s ping google.com
Sometimes commands may continue to run even after timeout sends the initial signal. In such instances, you can use the --kill-after option.
-k, --kill-after=DURATION
For example, the command shown is going to be terminated after 8 seconds.
# timeout 8s tail -f /var/log/syslog
Your Answer
x