Kill all processes not root or daemon

for p in $(ps -ef|tail +2|grep -v root|grep -v daemon|awk '{print $2}'); do
  kill -1 ${p}
done

Drop in a KSH script and run anytime you want to send a kill -1 to all processes that are not owned by root or running under daemon.

By |June 22nd, 2010|0 Comments