UNIX / Linux list current logged in users
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:
- FreeBSD Find out who is logged in?
- How can I find out who is logged on my UNIX / Linux system?
- Linux / UNIX find out what other users are doing?
- Server uptime command to find out how long the system has been running
- How can I change the message of the day on my Linux server?
Discussion on This FAQ
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!
Tags: Linux, print_user_names, UNIX, users_command



March 19th, 2008 at 10:33 pm
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:~$