#!/bin/bash ############################################################### # # # B!n@ry kprocess Kill Process Script :-D # # # # # # 1- Kills a given Process # # # # Back2Track, as I always say: Linux rul3z ... # # Binary@linuxac.org # # # ############################################################### # Howto use: # # ---------- # # 1- Add kprocess to ~/HOME/bin # # 2- Run chmod u+x kprocess # # 3- Open ~/HOME/.bashrc and ADD PATH=~/HOME/bin:$PATH # # 4- If you do not want to logout run source ~/HOME/.bashrc # # Note: If you logout no need for previous step # # 5- run from Terminal by printing kprocess # ############################################################### echo "Please enter process name to kill"; read PROCESSNAME; # To get PID(s) of the Process Name given and save in a file ps -C $PROCESSNAME -o pid= > PROCESSIDLIST; PIDKILLLIST=`cat PROCESSIDLIST` # To kill all PID(s) in the file for i in $PIDKILLLIST; do kill -9 $i; done; exit 0;