home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!brunix!brunix!pew
- From: pew@cs.brown.edu (Peter E. Wagner)
- Subject: Re: Script for killing mutiple processes?
- Message-ID: <1992Jul24.171126.20165@cs.brown.edu>
- Sender: news@cs.brown.edu
- Organization: Brown University Department of Computer Science
- References: <1992Jul21.135406.10224@ncsu.edu>
- Date: Fri, 24 Jul 1992 17:11:26 GMT
- Lines: 27
-
- In article <1992Jul21.135406.10224@ncsu.edu> odkahn@eos.ncsu.edu (Opher D. Kahn) writes:
- >I am working with a experimental database server that forks
- >off child processes to serve multiple clients. However, some
- >times these processes do not terminate correctly, and I am left
- >with 10-15 child processes that need to be killed. Is it possible
- >to somehow pipe the process numbers from 'ps -aux | grep dood' into
- >a kill command, so that I don't have to kill each one of them
- >manually??? (dood is the name of the process).
- >Thanks,
- >
-
- kill -9 `ps ax | egrep dood | egrep -v egrep | cut -c1-6` 1>& 2
-
- That should do it, though it is very undiscriminating in that it will
- kill absolutely everything named 'dood' w/o asking. I also have a
- program called nkill that kills processes by name. If there is more
- than one process with the same name, nkill gives you a list and allows
- you to select individual processes or All. Let me know if you want
- the program. I believe I can distribute it, but it's not ine so I
- have to check.
-
- >p
-
- ----------------------------------------------------------------
- Peter E. Wagner (212)460-5672 pwagner@ejv.com
- 52 E 13th St. Apt. 5E pew@BROWNCS.BITNET
- New York, NY 10003 uunet!brunix!pew
-