Re: netstat - kill by pid ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Thanks for the replies.

I don't want to run this script as sudo/root user and hence not
looking at lsof/fuser.

I think netstat and awk looks good solution for now. Following is what
I have used for now.
[[
netstat -nlp | grep 8082 | awk -F "/" '{ print $1 }' | awk '{ print $7 }'
]]

--
CS.

On Tue, Sep 28, 2010 at 12:33 PM,  <m.roth@xxxxxxxxx> wrote:
> Silviu Hutanu wrote:
>> Hi ,
>>
>> You can use this:
>>
>> kill -9 `netstat -antp|grep 8080|grep java|awk '{ print $7 }'|cut -d'/' -f
>> 1`
>>
>> But if had to do the same thing I would search in the running processes
>> instead using netstat, anyway you can extract the pid in the same way.
>>
> Yeah, but don't forget you may have shared memory, etc, left laying
> around. Those need to be cleaned out as well.
>
>     mark
>
> _______________________________________________
> CentOS mailing list
> CentOS@xxxxxxxxxx
> http://lists.centos.org/mailman/listinfo/centos
>
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux