- Whoami (command)
whoami is a command found on most
Unix-like operating systems,Windows Vista andWindows Server 2008 . It is a concatenation of the words "Who am I?" and prints the effective userid (username) of the current user when invoked.On Unix-like operating systems, the output of the command is slightly different from
$USER
becausewhoami
outputs the username that the user is working under, whereas$USER
outputs the username that was used to login. For example, if the user logged in as "John" andsu into "root",whoami
displays "root" andecho $USER
displays "John". This is because the su command does not invoke a login shell by default.The GNU version was written by
Richard Mlynarik and is part of theGNU Core Utilities (coreutils).The command is also available as part of the
Windows 2000 Resource Kit [ [http://www.microsoft.com/downloads/details.aspx?familyid=3E89879D-6C0B-4F92-96C4-1016C187D429&displaylang=en Windows 2000 Resource Kit Tool: Whoami.exe] ] andWindows XP SP2 Support Tools [ [http://www.microsoft.com/downloads/details.aspx?FamilyId=49AE8576-9BB9-4126-9761-BA8011FABF38&displaylang=en Windows XP Service Pack 2 Support Tools] ] .Example
# whoami root
ee also
*
logname
*id
*who
*User identifier (Unix)
*List of Unix programs References
External links
*man|1|whoami
* [http://technet2.microsoft.com/windowsserver/en/library/fc7edb8c-0e13-4d95-bb29-ad7464dac7071033.mspx?mfr=true Microsoft TechNet Whoami article]
Wikimedia Foundation. 2010.