Killing a process by its name
HI All,
Can we kill any process by its name in Linux??? I tried to find that but got no clue so i tried the following command to get those processes ps -aux |grep java > java now i got all the process with name java in it but now i dont know how to get that particular strings of PID out of it and kill it. Actually I want to cron the script of killing the process after everyone hour. By it should be by name. regards Rabeea |
Code:
killall <process name> |
Re: Killing a process by its name
Quote:
ps -ef|grep java| awk '{print $2}' | xargs kill {} \; |
you can even use alternative command if you wanna to kill a process by its name.
the command is:- pkill "process name" |
All times are GMT -5. The time now is 06:37 AM. |