From owner-freebsd-questions@FreeBSD.ORG Tue Apr 3 21:13:22 2012 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C496106566B for ; Tue, 3 Apr 2012 21:13:22 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id D59418FC1B for ; Tue, 3 Apr 2012 21:13:21 +0000 (UTC) Received: from r56.edvax.de (port-92-195-101-40.dynamic.qsc.de [92.195.101.40]) by mx01.qsc.de (Postfix) with ESMTP id DD4083CE91 for ; Tue, 3 Apr 2012 23:13:14 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id q33LDDMH005534 for ; Tue, 3 Apr 2012 23:13:14 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Tue, 3 Apr 2012 23:13:13 +0200 From: Polytropon To: questions@freebsd.org Message-Id: <20120403231313.6781abcc.freebsd@edvax.de> In-Reply-To: References: Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Subject: Re: current pids per tty X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Apr 2012 21:13:22 -0000 On Tue, 3 Apr 2012 16:47:57 -0400, Matthew Story wrote: > Across all TTYs, something like this would probably work: > > sudo fstat | awk '$5 ~ /^\/dev/ && $8 ~ /tty/ { printf "%s %s %s\n", $1, > $8, $3; }' | sort -k1,2 > > from there, if you think you need to trace the process trees down, you can > use this list of pids and ps to do the rest ... Or use "pstree" from ports. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...