Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

To kill all processes except mine -- Linux

16 views
Skip to first unread message
Message has been deleted

Ram

unread,
Nov 6, 2009, 3:14:18 AM11/6/09
to
Hi all,

I wanted to kill all process of one user except mine.Normally i use to
kill all the sessions using
this command

kill -9 -1

But this command will also kills even my process too . But i dont this
too happen.

2. How to find parent process and child process .

Regards

Ram

Mladen Gogala

unread,
Nov 6, 2009, 8:39:13 AM11/6/09
to

ps -fu oracle|awk '{ print $2; }'|grep -v $$|xargs kill -9

--
http://mgogala.freehostia.com

Mladen Gogala

unread,
Nov 6, 2009, 9:09:33 AM11/6/09
to

Alternatively, on Linux:

pgrep -u oracle|grep -v $$

--
http://mgogala.freehostia.com

bob123

unread,
Nov 7, 2009, 2:20:53 AM11/7/09
to
kill -9 -1
kill all you own (including the current)


"Ram" <krish...@gmail.com> a �crit dans le message de news:
656ba8f0-cc7c-4763...@z3g2000prd.googlegroups.com...

Mladen Gogala

unread,
Nov 7, 2009, 10:38:59 PM11/7/09
to
On Sat, 07 Nov 2009 08:20:53 +0100, bob123 wrote:

> kill -9 -1
> kill all you own (including the current)
>

Which is precisely what the OP does not want.

--
http://mgogala.freehostia.com

Andreas Piesk

unread,
Nov 8, 2009, 5:01:23 AM11/8/09
to

or just pkill. pkill can send signals to all processes belonging to a
user, group, parent, etc.

-ap

Loki

unread,
Nov 8, 2009, 1:55:27 PM11/8/09
to
On Sun, 08 Nov 2009 02:01:23 -0800, Andreas Piesk wrote:


> or just pkill. pkill can send signals to all processes belonging to a
> user, group, parent, etc.
>
> -ap

Unfortunately, you cannot filter out your process with pkill. That was
the requirement, if I remember correctly.

Andreas Piesk

unread,
Nov 8, 2009, 4:44:16 PM11/8/09
to

ah, you're right. i misunderstood that requirement.

-ap

0 new messages