Displays login name.
logname
The logname command displays the login name of the current process. This is the name that the user logged in with and corresponds to the LOGNAME variable in the system-state environment. This variable is only set when the user logs into the system.
The logname command invokes the getlogin subroutine to get the information about the login name.
Access Control: This program is installed as a normal user program in the Trusted Computing Base.
This command returns the following exit values:
Item | Description |
---|---|
0 | Successful completion. |
>0 | An error occurred. |
To display your login name to standard output, enter:
logname
Item | Description |
---|---|
/usr/bin/logname | Contains the logname command. |