To automatically kill stalled command after one second, put ‘timeout 1’ before the command.
$ timeout 1 cat
By itself, ‘cat’ would wait for input forever. But here, timeout kills it after one second.
Timeout is practical command to bypass problems with misbehaving binaries or complicated programs where you don’t want to fiddle with source code.