Hacker News new | ask | show | jobs
by geekytenny 5331 days ago
This is useful for finding and killing a process.

ps -A | grep some text in program name

upon getting the pid

kill -9 pid

4 comments

Instead of kill -9 (a nuke), you can often get results with just kill, kill -INT or kill -HUP. (The advantage is that the "weaker" signals allow your runaway program to do some cleanup, but kill -9 doesn't.)

There's a nice write-up and a function automating attempts to run increasingly strong signals on this site: http://web.archive.org/web/20080610070315/http://sial.org/ho...

(Thank god for the wayback machine. That site was full of good Unix tips and tutorials, but it's gone now.)

It's still there, just without a domain:

http://72.14.189.113/

Thanks for letting me know. It's still probably easier to use the Wayback Machine since all of the site's internal links point to http://sial.org/ so browsing within the site is very painful. Still, I'm glad to see the content is all still online. I may just mirror the whole thing (there's tons of good reference material in there, especially for Perl, but also for Unix generally).
Instead of the first, try "pgrep".
also check

killall programname

Be careful with killall -- BSD and Linux killall does what you say, but SysV killall kills every program on the machine.

Most of us probably won't be executing killall on any HPUX or IRIX boxes, but it's still good to know the difference ;)

pkill

pidof