Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Terminate user sessions.
@ 2000-05-17  4:00 Michael J.
  2000-05-17  4:00 ` Michael Sternberg
  0 siblings, 1 reply; 2+ messages in thread
From: Michael J. @ 2000-05-17  4:00 UTC (permalink / raw)


Hi,

I am looking for a command to terminate all user sessions and their
processes. Something like:

finger -f | grep -v root | cut -f 1 -d " " | kill . . . . . .

Many thanks!!





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Terminate user sessions.
  2000-05-17  4:00 Terminate user sessions Michael J.
@ 2000-05-17  4:00 ` Michael Sternberg
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Sternberg @ 2000-05-17  4:00 UTC (permalink / raw)


"Michael J." wrote:
> finger -f | grep -v root | cut -f 1 -d " " | kill . . . . . .

You need ps.  Here are two solutions:

All user pids:

    ps -eo pid,user | awk '! /root/ && ! /PID/ {print $1}' | xargs kill

Pids of logged-in users only:

    ps -eo pid -u `u | sed s/root//` | tail +2 | xargs kill

Note that the pids just get a sig; they may choose to ignore it, unless
you give them kurare #9.


But how about:

    init s



Regards,
-- 
Michael Sternberg,  Dipl. Phys.          | Uni-GH Paderborn
http://www.phys.uni-paderborn.de/~stern/ | FB6 Theoretische Physik 
phone: +49-(0)5251-60-2329   fax: -3435  | 33098 Paderborn, Germany
"Who disturrrbs me at this time?"  << Zaphod Beeblebrox IV >>	<*>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-05-17  4:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-05-17  4:00 Terminate user sessions Michael J.
2000-05-17  4:00 ` Michael Sternberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox