February 14, 2021 in Tutorial2 minutes
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
vagrantWe can also pass the utmp file to users command and the output will be the same.
users /var/run/utmp
vagrantWe 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 man or info page you can press q.
man usersinfo page for users command can be opened using the command below.
info usersTo open help page from users command we can run command below.
users --helpYou 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.