logname
prints the user's login name
TLDR
Print login name
$ logname
SYNOPSIS
logname [options]
DESCRIPTION
logname prints the user's login name. It reads from the utmp file to determine the original login.
Unlike whoami, logname shows the login name even after su or sudo commands.
PARAMETERS
--help
Display help information.--version
Display version information.
CAVEATS
May fail if not run from a terminal. Differs from whoami after su. POSIX standard command.
HISTORY
logname is a traditional Unix command from POSIX, showing the name used to log into the system.

