August 1999
Intermediate to advanced
1000 pages
83h 9m
English
/usr/ucb/whoami
whoami displays the login name corresponding to the current effective user ID. If you have used su to temporarily adopt another user identity, whoami reports the login name associated with that user ID. whoami gets its information from the geteuid and getpwuid library routines (see getuid(2) and getpwnam(3C)).
The following examples show the current effective user ID. Because root does not have /usr/ucbt in the search path, the full path name is required to execute the command as root.
castle% whoami winsor castle% su # whoami whoami: not found # /usr/ucb/whoami root # exit castle% su ray castle% whoami ray castle%
| /etc/passwd | User name ... |
Read now
Unlock full access