February 14, 2021 in Tutorial2 minutes
In this tutorial, we learn how to use the logname
command in Linux. This command in print user’s login name.
logname [OPTION]
To use logname
command in Linux we just have to run this command, no options or parameter to be passed to this command.
$ logname
vagrant
The output above shows that my current username is vagrant
.
We can use man
and info
command to see the manual page of logname
command.
logname
command also have --help
option to show list of options.
To open man page for logname
command we can use command below. To exit man or info page you can press q
.
man logname
To open info page for logname
command we can use command below.
info logname
To open help page from logname
command we can run command below.
logname --help
You can find logname
command source code from the following repositories:
You can read tutorials of related Linux commands below:
In this tutorial, we learn how to use the logname
command in Linux with practical examples. Visit our Linux Commands guide to learn more about using command-line interface in Linux.