From owner-freebsd-questions Fri Jan 25 11:24:50 2002 Delivered-To: freebsd-questions@freebsd.org Received: from drex.staff.izr.com (drex.staff.izr.com [195.26.33.16]) by hub.freebsd.org (Postfix) with ESMTP id 5E8CC37B41B for ; Fri, 25 Jan 2002 11:24:46 -0800 (PST) Received: by drex.staff.izr.com (Postfix, from userid 1001) id A8A20337AA; Fri, 25 Jan 2002 19:24:44 +0000 (GMT) Date: Fri, 25 Jan 2002 19:24:44 +0000 From: Mark Drayton To: Lance Bland Cc: adrian kok , questions@FreeBSD.ORG Subject: Re: number of users Message-ID: <20020125192444.A3916@drex.staff.izr.com> References: <20020125190013.23955.qmail@web21210.mail.yahoo.com> <0C288440-11C8-11D6-A67C-0030659A531A@vvi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <0C288440-11C8-11D6-A67C-0030659A531A@vvi.com>; from lbland@vvi.com on Fri, Jan 25, 2002 at 02:16:34PM -0500 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Lance Bland (lbland@vvi.com) wrote: [..snip..] > If you just want to know how many are logged in then "finger" might > work. or you might want to use "last", or "ac -p" Original poster: these methods will show how many users are currently logged in. The following will tell you have many user accounts you have with a UID > 1000 (ie non-system accounts): grep -v '^#' /etc/passwd | awk -F: '{ if ($3 > 1000) print $0 }' | wc -l eg: === mark@mir:~$ grep -v '^#' /etc/passwd | awk -F: '{ if ($3 > 1000) print $0 }' | wc -l 5 Cheers, -- Mark Drayton To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message