Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.3: Kill another user logged in under Fast User Switching' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Kill another user logged in under Fast User Switching
Authored by: amusingfool on Dec 01, '03 12:35:36PM

well, if you don't mind them not being able to save, you can use the following (bash) shell function

[code]
function killuser() {
sudo kill -9 `ps -auxg |grep $1 |grep -v grep |awk '{ print $2; }'`;
}
[/code]

the first argument (substituted for $1) should be the username of the user in question. If you really want to just get their loginwindow (not recommended), you can do:
[code]
function killuser() {
sudo kill -HUP `ps -auxgww |grep $1 |grep loginwindow |grep -v grep |awk '{print $2; }'`;
}
[/code]

Note that the ww in the ps options is very important, unless you use _very_ wide windows.



[ Reply to This | # ]