Your Ad Here

Kamis, 01 November 2012

Unix Tip: KILL X

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

UNIX GURU UNIVERSE
UNIX HOT TIP

Unix Tip 3554 - November 1, 2012

http://www.ugu.com/sui/ugu/show?tip.today

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


KILL X

Quick way to close your X login session (for SysV)

for PID in `ps -u$USER | grep "fv[wm]" | awk '{print $1}'`; do kill -9 $PID; done

Or throw it into a shell script:

--- cut here ---
#!/bin/sh

for PID in `ps -u$USER | grep "fv[wm]" | awk '{print $1}'`; do
kill -9 -$PID
done
--- cut here ---

(the [] conceal the grep from ps, which would mean it would
kill itself before doing anything useful. as written up,
it looks for fvwm's process, which is the window manager I
use; rewrite it as needed i.e. for Motif - mwm,
Open Look - olwm, etc.)

Write this up in a shell script contained in your $PATH
or alias it and you're cooking with gas.

This tip generously supported by: klaus@imprint.uwaterloo.ca


--------------------------------------------------------------------------
To Subscribe: http://www.ugu.com/sui/ugu/show?tip.subscribe
To Unsubscribe: http://www.ugu.com/sui/ugu/show?tip.unsubscribe
To Submit A Tip: http://www.ugu.com/sui/ugu/show?tip.today

==========================================================================
DISCLAIMER: All UNIX HOT TIPS ARE OWNED BY THE UNIX GURU UNIVERSE AND ARE
NOT TO BE SOLD, PRINTED OR USED WITHOUT THE WRITTEN CONSENT OF THE UNIX
GURU UNIVERSE. ALL TIPS ARE "USE AT YOUR OWN RISK". UGU ADVISES THAT
ALL TIPS BE TESTED IN A NON-PRODUCTION DEVELOPMENT ENVIRONMENT FIRST.

Unix Guru Universe - www.ugu.com - tips@ugu.com - Copyright 1994-2001
==========================================================================

Tidak ada komentar:

Posting Komentar

Your Ad Here
Free Automatic Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink Free Auto Backlink