I want a way to kill a random process with a name (like a random perl process).
What would be the best way to do this?
I was thinking about using something like this:
ps aux | grep PROCESS-NAME
to the file, then find the random line number, get the second column (process ID?) and kill it.
For my use, it’s not really necessary to be random if it kills one of the processes. Making it random just makes it better.
source
share