Sometimes you want to kill all user process, you can’t do “kill -9 PID” for all process that users have.
You can use this trick
Example :
You (as root), want to kill all process which is had by user “oracle”.
Maybe you want to use this script before you shutdown immediate your Oracle DB
# ps -ef | grep ora | grep -v root | awk ‘{print $2}’ | while read line; do kill -9 $line; done