This a small post about a linux command make my life easier, when i want to kill a process i was using to get PID then use kill with this process PID, this was require that i do the next long line:
kill < `ps aux | grep process_to_kill | awk ‘{print $2}’ | head -n 1`
Recently, i found the equivalent of this painfull line 🙂 :
pkill process_to_kill
But without the first line i used to use i wouldn’t get familiar with ps, awk, head, tail. But now for sure i will use pkill :).
Nice One! How did you find it?
I got it from a good article on http://www.thegeekstuff.com on 4 ways to kill a process, it’s a nice article to read :
http://www.thegeekstuff.com/2009/12/4-ways-to-kill-a-process-kill-killall-pkill-xkill/
Nice article, i think xkill command is a good one too.
Do you know about killall?
I knew aslo the killall from
http://www.thegeekstuff.com/2009/12/4-ways-to-kill-a-process-kill-killall-pkill-xkill
pkill is better to not write exact name as it takes a part of name, for example to kill evolution mail client i just use pkill evol, to kill all processes related to evolution.
pkill is faster than killall