logname Command
Purpose
Displays login name.
Syntax
logname
Description
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.
Security
Access Control: This program is installed as a normal user program in the Trusted Computing Base.
Exit Status
This command returns the following exit values:
Item | Description |
---|---|
0 | Successful completion. |
>0 | An error occurred. |
Examples
To display your login name to standard output, enter:
logname
Files
Item | Description |
---|---|
/usr/bin/logname | Contains the logname command. |