I am trying to write a command that will kill all processes matching a string. I have permissions to execute kill -9 but when I try to do pkill -f string I get operation not permitted.
Here is what I have so far:
ps aux | grep -E 'python2|python3'
That gets all the PIDs of all python processes. However, my sed and grep magic isn't good enough to parse out the pids to do:
kill -9 | <sed magic> | grep -E 'python2|python3'
Can someone help with said magic?