How to Kill a Process

Hi,

how can i kill one running process, how can i get the process id

thanks .BJ

# pkill procname

or look for the process with
# ps -ef | grep -i procname
and then kill the proc with its pid
# kill pid
maybe you need it a little harder
# kill -9 pid

1 Like

ps -ef
find the process in question
kill pidnumber if that doesn't work you can kill -9 pidnumber
man kill for further information on kill

most of the times,
kill pid will work..
how ever ,here i have a question.
how do you figure out the name of the running process.
I know you can use ps -e|grep -procname,
however the name that it has when operating on the terminal is different than what we see on the gui models...
so is there a way to find out the name without doing a ps ...

What GUI models ?

Have you an example with such a discrepancy ?

@wrapster
The names are not different, its just that GUI shows you the actual procname ONLY and ps -ef shows u bit of a listing

a better way to use ps is to use the Berkley ps

/usr/ucb/ps -auxwww | grep -i <whatever>

If you want to go deep into the process related stuffs like what a process is doing, what files it is opening, what libraries it is calling, then use the proc tools.

/usr/proc/bin/*

-s4g3