1833875 Members
1912 Online
110063 Solutions
New Discussion

kill process the user

 
Rene Mendez_4
Super Advisor

kill process the user

Hello
I have hpux 11i i need kill all process the one user (40 process)how to.


5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: kill process the user

Hi Rene:

# ps -u |awk 'NR>1 {print $1}'|xargs kill


...where is the 'uid' *or* the user's name.

Regards!

...JRF...
Michael Steele_2
Honored Contributor

Re: kill process the user

ps -ef | grep -i user | while read a
>do
>kill -9 $a
>done
Support Fatherhood - Stop Family Law
Michael Steele_2
Honored Contributor

Re: kill process the user

Excuse me:

ps -ef | grep -i user | while read a b c d
>do
>kill -9 $b
>done
Support Fatherhood - Stop Family Law
James R. Ferguson
Acclaimed Contributor

Re: kill process the user

Hi (again):

Don't 'kill -9' except as an absolute last resort. A 'sigkill' can't be trapped and therefore the process in question has no opportunity to remove temporary files and/or detach shared memory segments. In the later case this leaves memory tied up.

Instead, start with a 'kill -15' -- the default if a simple 'kill' without further argument is given; then if that doesn't work, use 'kill -1' and as a last resort 'kill -9'. See 'man kill' for more information.

Regards!

...JRF...
Tim Howell
Frequent Advisor

Re: kill process the user

Here is how I do it...

ps -fe|awk `/uname/{print "kill -15 " $2}` |sh

uname should be the actual user name...

Hope this helps...
if only we knew...