A UNIX Command
$logname
jeffrin
$logname --help
Usage: logname [OPTION]
Print the name of the current user.
--help display this help and exit
--version output version information and exit
Report logname bugs to bug-coreutils@gnu.org
GNU coreutils home page:
General help using GNU software:
For complete documentation, run: info coreutils 'logname invocation'
$logname --version
logname (GNU coreutils) 8.5
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by FIXME: unknown.
$
UNIX Explanation
Solaris Based Explanation
The logname utility will write the user's login name to
standard output. The login name is the string that would
be returned by the getlogin(3C) function. Under the
conditions where getlogin() would fail, logname will
write a diagnostic message to standard error and exit
with a non-zero exit status.