How to list all OS users on RH 9 ?

Rick Stevens rstevens at vitalstream.com
Mon Jun 28 17:48:34 UTC 2004


Bob McClure Jr wrote:
> On Mon, Jun 28, 2004 at 12:00:13PM -0400, Chris A Czerwinski wrote:
> 
>>When I execute the command in terminal, I get the following response
>>
>>[chris at localhost chris]$
>>$ who -q
>>chris chris
>>#users=2
>>
>>How can there be 2 users?
>>
>>Chris (Newbie)
> 
> 
> It is counting the instances of logins.  You are apparently logged in
> twice.  I can get the same result by being logged in to my X session
> and a text terminal, tty2 (Ctrl-Alt-F2).
> 
> 
>>On Mon, 2004-06-28 at 00:31, sg at pobox.com wrote:
>>
>>>On RedHat Linus command is who -q
>>>
>>>Rajeev.
>>>
>>>*====================================
>>>On Monday 28 June 2004 07:42, Yan Peng wrote:
>>>
>>>>redhat-install-list:
>>>>
>>>>	 On solaris, there is one command listusers to list all OS users. I'd like
>>>>to know what command can do the same work on RH 9 ? Many thanks.
>>>>
>>>>
>>>>
>>>>Yan Peng
>>>>yanpeng at mx.cei.gov.cn
>>>>2004-06-28
> 
> 
> What was unclear in the initial query was whether he wanted users
> _currently_logged_in_ or all the users that existed on the machine.
> The awk one-liner I posted will do the latter.  "who -q" (and
> "finger", more verbosely) does the former, but as logins, not distinct
> users.

You can also use "lastlog" to see the entire user list as well as the
last time the user logged in, which port they were on and (if a remote
login), where they logged in from.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-               The Theory of Rapitivity: E=MC Hammer                -
-                                  -- Glenn Marcus (via TopFive.com) -
----------------------------------------------------------------------





More information about the Redhat-install-list mailing list