I have a multiple processes with a similar keyword. I have to kill all the process at one shot. Like
ps -ef |grep raj
root 3129 1 0 15:32 ? 00:00:00 /usr/lib/raj/msisdn
root 3165 1 0 15:36 ? 00:00:00 /bin/sh /usr/lib/raj/raj-1.sh
root 3166 3165 0 15:36 ? 00:00:00 /usr/lib/raj/raj-2
root 3170 2236 1 15:36 pts/0 00:00:00 grep raj
I heard that this can be done using awk. One liner command to kill all the process is what I need 🙂
What about:
I’d recommend running
first, to make sure you’re killing the right processes.
EDIT: If you want to use awk, try:
but it’s more verbose than pgrep and kill.