Ubuntu – Kill zombie processes

for each in `ps -j auxww | grep Z | grep -v PPID | awk ‘{print $3}’`; do for every in `ps auxw | grep $each | grep cron | awk ‘{print $2}’`; do kill -9 $every; done; done

 

sudo ps -fe | grep -i “defunc” | awk {‘print “kill -9 “$3’} | sudo sh