logname
logname displays the login name of the person who issued the command. It obtains the login name through the getlogin() function defined in the POSIX standard. The login name is displayed as all uppercase letters, regardless of how it was entered.
See Localization for more information.
POSIX.2, X/Open Portability Guide, UNIX System V.
env, id