Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jan 2002 19:24:44 +0000
From:      Mark Drayton <mark.drayton@izrsolutions.com>
To:        Lance Bland <lbland@vvi.com>
Cc:        adrian kok <adriankok2000@yahoo.com.hk>, questions@FreeBSD.ORG
Subject:   Re: number of users
Message-ID:  <20020125192444.A3916@drex.staff.izr.com>
In-Reply-To: <0C288440-11C8-11D6-A67C-0030659A531A@vvi.com>; from lbland@vvi.com on Fri, Jan 25, 2002 at 02:16:34PM -0500
References:  <20020125190013.23955.qmail@web21210.mail.yahoo.com> <0C288440-11C8-11D6-A67C-0030659A531A@vvi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020125192444.A3916>