Linux logname Command

In this tutorial we learn how to use logname command in Linux. The logname command print current user login name.

What is Linux logname Command?

In this tutorial, we learn how to use the logname command in Linux. This command in print user´s login name

logname Syntax

logname [OPTION]

Using logname command in Linux

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.

logname Command Manual / Help

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

Linux logname Command Source Code

You can find logname command source code from the following repositories:

You can read tutorials of related Linux commands below:

Summary

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.