Wednesday, May 21, 2008

Terminate Process on UNIX

If you want to terminate a process in unix or if you start a process and it shows it is already running then you need to kill the process. On unix in order to kill the process first find the process id. And then kill by kill -9.

Suppose in my computer my firefox was not responding so I right click on firefox title bar and kill them. Now whenever I tried to run process it showed me the process is already running.

What I did is
1)log on as a root user.

Arju@debian:~$ su
Password:


2)Now find the process id of firefox.
debian:/home/Arju# ps -ef |grep firefox
root 3060 1 14 08:03 pts/0 00:00:23 /usr/lib/iceweasel/firefox-bin -a firefox
root 3090 3088 0 08:06 pts/0 00:00:00 grep firefox

So it is 3060,1.
3)Kill by,
debian:/home/Arju# kill -9 3060 1

Now I started firefox and it is ok.

No comments:

Post a Comment