logname Command Examples in Linux

logname command prints the user’s login name. For example:

$ logname
geek

logname Comman Options

Option Description
–help display this help and exit
–version output version information and exit

1. To print the users login name:

# logname

2. To get the help for logname command:

# logname --help 

3. To output version information:

# logname --version 
Related Post