i can’t believe this worked the first time
so i wrote this on a server today hoping to kill off a bunch of duplicated processes that were locked up… as the title states, it worked the first time! i think this will work in most linux distros that have the -ef flag for the ps command:
ps -ef | grep -v grep | grep [runaway process]| awk ‘{print $2}’ | xargs kill -9
in a nutshell, it prints out the process id from the ps command and uses xargs to pipe it to the kill process.
whew! it saved me a ton of typing, so i thought i’d share.
-m