Article submitted by Carsten Aulbert. Guess what? We still need you to submit good articles about software you like!
timeout (part of the SATAN package) is a nice little tool to terminate/send a signal to a process after a given time.
It usually takes two arguments, the first one is the time limit in seconds and the second the program to start. All trailing options are then passed to the started program.
It accepts a single numerical option which specifies what signal to send — be careful as its default is SIGKILL.
Quite useful on many occasions, e.g.: strace stats of a process PID for the next 300 seconds
timeout -2 300 strace -tt -c -p PID
Ensure that your kids don’t play childsplay all day long (of course you need to make sure that they won’t be able to restart it ;))
timeout 3600 childsplay
Similar programs could be timelimit.