From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 9 00:02:37 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A7B0106564A for ; Thu, 9 Dec 2010 00:02:37 +0000 (UTC) (envelope-from richo@psych0tik.net) Received: from erinyes.site5.com (erinyes.site5.com [74.53.114.10]) by mx1.freebsd.org (Postfix) with ESMTP id E937A8FC13 for ; Thu, 9 Dec 2010 00:02:36 +0000 (UTC) Received: from boxand.lnk.telstra.net ([203.45.130.125] helo=richh-desktop.boxdice.com.au) by erinyes.site5.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1PQSq6-0004Id-0u for freebsd-hackers@freebsd.org; Wed, 08 Dec 2010 16:50:22 -0600 Date: Thu, 9 Dec 2010 09:49:22 +1100 From: richo To: FreeBSD-Hackers Message-ID: <20101208224922.GA14847@richh-desktop.boxdice.com.au> References: <4D000448.1050606@telenix.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <4D000448.1050606@telenix.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - erinyes.site5.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - psych0tik.net X-Source: X-Source-Args: X-Source-Dir: Subject: Re: getting a list of open files versus PID nos.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2010 00:02:37 -0000 On 08/12/10 17:18 -0500, Chuck Robey wrote: >What I want to see is a list of all Pids and how many open files >there are associated with each Pid? And maybe a "ps ax" list, so I >can associate an application with a pid. I would set things up so it >would do this every 15 minutes, and it might just point me at my real >Any idea what would be the best way to get a list of all openfiles >versus each open pid? I would be happy to write up a python script >to give me application versus count of open files list, if I could >start with that files versus pids thing. lsof is what you're looking for.