From owner-freebsd-hackers Fri Mar 1 15:57:14 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from saruman.xwin.net (saruman.xwin.net [205.219.158.250]) by hub.freebsd.org (Postfix) with ESMTP id 3EA3B37B402 for ; Fri, 1 Mar 2002 15:57:10 -0800 (PST) Received: from localhost (dp@localhost) by saruman.xwin.net (8.11.4/8.11.4) with ESMTP id g21Nw0v13775; Fri, 1 Mar 2002 17:58:00 -0600 Date: Fri, 1 Mar 2002 17:58:00 -0600 (CST) From: Paul Halliday X-X-Sender: To: Dan Nelson Cc: "Daniel O'Connor" , Danny Braniss , Patrick Thomas , Subject: Re: how do I see the current number of PTYs in use ? In-Reply-To: <20020301224926.GC3548@dan.emsphone.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 1 Mar 2002, Dan Nelson wrote: > In the last episode (Mar 02), Daniel O'Connor said: > > On Fri, 2002-03-01 at 21:19, Danny Braniss wrote: > > > fstat | awk '{print $8}' | egrep 'tty[pqrsPQRS]' | sort -u | wc -l > > > > > > is IMHO correct, ;-) > > > > Ach, of course :) > > I hope the original poster is satisfied 8-) > > Easier might be "pstat -t | grep 'tty[pqrsPQRS]' | wc -l" Actually, you are missing a delimiter for your output in the 'State' column for pstat. Dead terminals still appear but this flag changes. Not very accurate as is, unless you grep the OCc. [06:54pm]-root@dissent~# pstat -t | grep 'tty[pqrsPQRS]' | wc -l 8 [06:54pm]-root@dissent~# pstat -t | grep 'tty[pqrsPQRS]' | grep OCc | wc -l 5 [06:54pm]-root@dissent~# fstat | awk '{print $8}' | egrep 'tty[pqrsPQRS]' | sort -u | wc -l 5 fstat is still the winner. > > -- > Dan Nelson > dnelson@allantgroup.com > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > Paul H. "Don't underestimate the power of stupid people in large groups" ___________________ http://dp.penix.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message