Identifying a running process

Tony Baldwin photodharma at
Thu Jun 18 15:26:33 UTC 2009

GaryT wrote:
> I want to learn how to identify and then stop a process - for example 
> today I tried to restart a program that had just crashed and Ubuntu gave 
> me a message along the lines of "XYZ is still running but not 
> responding. Stop the process or reboot before trying again" or words to 
> that effect.
> Rebooting was highly undesirable because it meant shutting down other 
> programs.  Too bad!
> Can someone help save the search and point me to some appropriate 
> reading matter?
> Much appreciated
> GT

The easiest way for a n00b would be to use a gui sysmon like 
gnome-system-monitor or gps, find the process and click the kill button.
Alternatively, you could use something like top or htop to find it.
htop, I believe, will allow you to kill the process.
It is about as easy to use as a gui, but runs in terminal.
Pretty handy.

For top, I would do something like
top -n 3
and locate the pid no.
then you would use
kill -s pid
to kill the process.

Another means of finding the pid would be something like
ps aux | grep programname

Like, were I looking for iceweasel, I would do

tony at deathstar:~$ ps aux |  grep iceweasel
tony      1236  4.6 17.5 379020 272284 ?       Sl   Jun15 209:04 
/usr/lib/iceweasel/firefox-bin -a iceweasel
tony     21280  0.0  0.0   3120   740 pts/0    S+   11:23   0:00 grep 

Then I should  be able to do
kill -s 1236
to kill it.

Only, for some reason that never works for me, so I just use gps or htop.
(Maybe I'm doing something wrong with my kill commmand?  Someone with 
better knowledge could clear that up, here.)


free/open source software
tcl yer os with a feather...

More information about the ubuntu-users mailing list