Linux users Command
Posted on February 14, 2021 (Last modified on July 14, 2022) • 2 min read • 271 wordsHow to show the current user in Linux? we can use users command in Linux that will provide the information written in utmp file.
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 [OPTION]... [FILE]
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 the same.
users /var/run/utmp
vagrant
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
You can find users command source code from the folowing repositories:
You can read tutorials of related Linux commands below:
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.