File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Linux / UNIX and the fly likes Killing More than one process Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Killing More than one process" Watch "Killing More than one process" New topic

Killing More than one process

rohan yadav
Ranch Hand

Joined: Oct 13, 2009
Posts: 156
Hi everyone,
I wanted to know how to kill more than one process in unix??
e.g- I have problem statement as
"Write a shell script to Kill all processes started from your login "

Sage of The Monstrous Toad of Mount Myoboku
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

If all the processes had the same name, you could use "killall".

But as far as all created since time "X", I've never ever found a use for that. Usually I want to pick a root process and kill all its children, not kill possibly unrelated apps and services that are just minding their own business. Of course, one of my favorite apps to kill that way is Firefox, since its cache can get very, very greedy, and that's AFTER I put limits on it.

An IDE is no substitute for an Intelligent Developer.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Something like this:
I agree. Here's the link:
subject: Killing More than one process
It's not a secret anymore!