- To: Ben Leslie <benno@xxxxxxxxxxxx>
- Subject: Re: [SLUG] Select and kill running process
- From: Umar Goldeli <umar@xxxxxxxxxxxxxx>
- Date: Tue Aug 22 10:16:13 2000
- Cc: Terry Collins <terryc@xxxxxxxxxx>, slug@xxxxxxxxxxx
Slightly simplified version is:
ps -uaxw|grep process|awk '{print $2}'|xargs kill -9
(adjust $2 with regards to the args on ps)
//umar.
> seems to work for me.
>
> kill takes the PID afaik, which is the first argument of ps axf.
>
> The pid is right justified so I strip the spaces off the front, and then use
> cut to get the first field (being the PID).
>
> This works, _BUT_ I'm sure there is another (probably better) way of doing
> it.
>
> Cheers,
>
> Benno