Automating Killall then Killall level 9
Sometimes I want to killall of a certain process, but running killall doesn't work. So when I try to start the process again, it fails because the previous session is still running. Then I have to tediously run killall -9 on it. So to simplify my life, I created a realkill script and it goes like this: PIDS=$(ps aux | grep -i "$@" | awk '{ print $2 }') # Get matching pid's. kill $PIDS 2> /dev/null # Try to kill all pid's. sleep 3 kill -9 $PIDS 2> /dev/null # Force quit any remaining pid's. So, Is this the best way to be doing this? In what ways can I improve this script? Avoid killall if you