About Linux FAQ

Browse More FAQs:

UNIX / Linux list current logged in users

Posted by Vivek Gite [Last updated: October 2, 2007]

Q. How do I print the user names of users currently logged in to the current UNIX / Linux host / server from a command prompt?
A. You need to use users command. It displays the login names of the users currently on the ystem, in sorted order, space separated, on a single line. It reads all information from /var/run/utmp file.

users command

Just open terminal or login over ssh session and enter the following command:
$ users
Output:

abhi charvi vivek vivek zcafe

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Other Helpful FAQs:

Discussion on This FAQ

  1. confy Says:

    but why not using “w”??

    confy@live:~$ w
    00:35:35 up 13 days, 1:35, 2 users, load average: 0.27, 0.34, 0.58
    USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
    confy tty7 :0 06Mar08 0.00s 3:06 1.59s x-session-manager
    confy pts/0 :0.0 00:33 0.00s 0.09s 0.00s w
    confy@live:~$

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , ,

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.