SyntaxFix
Write A Post
Hire A Developer
Questions
A very simplistic way:
# command & sleep 5; pkill -9 -x -f "command"
with pkill (option -f) you can kill your specific command with arguments or specify -n to avoid kill old process.