I would try first with a soft kill. Note: PID is the process ID of the program.
kill PID
If that didn't worked, try the one below
kill -9 PID
The one below kills a process by the name of the running program rather than the PID.
pkill
program
Quote:
Originally Posted by narasimhasrkr
but its killing another process suppose if i try to kill with processname sub processes in that process converting as daemon process and its not killing sub processes when killing parent process.
|
Not sure I understand your meaning above, but try the code below. But before you run it, read what it does first.
pkill -P $( pgrep
program_name )
This will kill a program's parent PID ( i.e the main program ) and it's child processes ( i.e other programs started by the main program ).
Replace
program_name in bold with the name of the program or script you want to kill.
Remember, only the user who owns the process can kill the process. A user cannot kill another user's process. Only root can do that.