Stop an application after a specific amount of time

Recently updated at April 10, 2018

Sometimes you want to stop a process after it is running for some time. Probably because you want to avoid a script or process being stuck, or simply limiting the resources it can use.

Commands

timeout --kill-after=5s 10s sleep 8

Run a command for a while and set a timeout to it, after which is will be terminated automatically



What do you think, was this useful?

Yes!

Share with friends:
Share on Twitter