From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] killing rogue processes In-Reply-To: Your message of "Thu, 18 Dec 2003 13:01:55 MST." <8574297c804834f9ee3c9801362189f8@plan9.ucalgary.ca> From: "Russ Cox" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <54000.1071774802.1@t40.swtch.com> Message-Id: Date: Thu, 18 Dec 2003 14:13:22 -0500 Topicbox-Message-UUID: ac72ccf8-eacc-11e9-9e20-41e7f4b1d025 > > netstat -n to get the tcp channel and grep tcp/channel /proc/*/fd. I'm sure > > you can do the shell script around that. > > I have an 'lsof' that lists all file descriptors + process #s.. just grepping for 'tcp' > gave me the clues... > > I've even sent the code+man page to 9trouble, but don't know what happened :) i don't remember the one you sent to 9trouble, but it seems trivial enough not to warrant a separate command: #!/bin/rc cd /proc for (i in *) cat $i/fd | sed s/^/$i' '/