Originally published at: https://www.cyberciti.biz/faq/linux-run-a-command-with-a-time-limit/
I want to start command called foo, and kill it if still running after given DURATION in seconds. How do I run a command a time Limit on Linux? How do I run a Linux command, and have it timeout (abort) after N seconds? Can you give timeout command examples in Linux?