In this blog we will learn about kill command .We can use a kill command to killprocesses in Linux.First of all lets open our terminal , We can press ctrl+alt+ t to do this .
1.To use kill command you can just write a kill and then flags using minus after that the PID of the process which you want to kill .So I need to know the PID of a process in order to kill . So Basic command looks like :
$kill -flags PID . We can use ac ommand to know the PID of a process :
$pidof process_name .
2.If the above command doesn’t kill or isnot able to kill a process somehow there is a little bit stronger flag .The flag you need to use : -KILL . It will force the process to be closed but it’snot recommended but if you need it in some circumstances then you can use. Command :
$kill -KILL PID .
3.One more flag is -9 . Command :
$kill -9 PID
4.Sometimes you don’t even know then ame of the process .Inorder to find out the list of running processes on your system what you can do is :
i)$top command (described in previous blog)
so in this way also you can use this ps command to find out the PID of process and then later kill it .