Step 1/1: A time limit

timeout DURATION COMMAND runs a command and sends TERM when time is up; the exit status is then 124. Durations: 30 (seconds), 5m, 1h; -k 5 sends KILL if it is still running 5 seconds after TERM.

$ timeout 5 ./slow.sh
Fundamentalstimeoutprocess
Give a command a time limit
./slow.sh takes a minute. Run it, but let it run for 3 seconds at most, then end it automatically.

This exercise needs real Linux

The commands it uses (processes, networking and more) are not in the simulator. Switch to real Linux and the exercise runs in a real Linux system inside your browser.

reniceNext lesson:watch