I think I have a shell script (launched by root's crontab) that's stuck in a loop. How do I list running scripts and how can I kill them?
I'm running Ubuntu 9.04, but I imagine it's similar for all *nix systems...
ps -ef
will show you list of the currently running processes. Last field is the process name and parameters. Find the process you are looking for, and look at the 2nd column. 2nd column is process id or pid
.
Then do kill -9 <pid>
to kill that particular process.
If you want a more stripped down version with better ASCII art (in my opinion I suppose) you can do
pstree -p
ps auxfwww
will give you an ASCII art tree diagram of all the processes running on the system. From there it's just a matter of tracing down from the cron daemon and running kill
against the appropriate PID.
Or just good old top
command, which will show a toplist of most resource-hungry processes.