Linux users Command

How to show the current user in Linux? we can use users command in Linux that will provide the information written in utmp file.

What is Linux users Command?

In this tutorial we learn how to use users command in Linux. users command print the user names of users currently logged in to the current host.

users Syntax

users [OPTION]... [FILE]

Using users command in Linux

We can pass a file to be read by users command. By default users command will read file /var/run/utmp

users
vagrant

We can also pass the utmp file to users command and the output will be thesame

users /var/run/utmp
vagrant

Manual Page / Info Page of users Command

We can use man and info command to see the manual page of users command.

users command also have --help option to show list of options.

man page of the users’ command can be opened using the command below. To exit the man or info page you can press q.

man users

info page for users command can be opened using the command below.

info users

To open help page from users command we can run command below.

users --help

Linux users Command Source Code

You can find users command source code from the folowing repositories:

You can read tutorials of related Linux commands below:

Summary

In this tutorial we learn how to use users in Linux with practical examples. Visit our Linux Commands guide to learn more about using command line interface in Linux.