Whoami

Last updated
whoami
Developer(s) Bill Joy, Richard Mlynarik, Intel, Microsoft, ReactOS Contributors, Novell
Operating system Unix, Unix-like, iRMX 86, Windows, ReactOS, NetWare
Platform Cross-platform
Type Command
License BSD: BSD License
coreutils: GPLv3
iRMX 86, Windows, NetWare: Proprietary commercial software
ReactOS: GPLv2

In computing, whoami is a command found on most Unix-like operating systems, Intel iRMX 86, every Microsoft Windows [1] operating system since Windows Server 2003, and on ReactOS. It is a concatenation of the words "Who am I?" and prints the effective username of the current user when invoked.

Contents

Overview

The ReactOS whoami command ReactOS-0.4.13 whoami command 667x434.png
The ReactOS whoami command

The command has the same effect as the Unix command id -un . On Unix-like operating systems, the output of the command is slightly different from $USER because whoami outputs the username that the user is working under, whereas $USER outputs the username that was used to log in. For example, if the user logged in as John and su into root, whoami displays root and echo $USER displays John. This is because the su command does not invoke a login shell by default.

The earliest versions were created in 2.9 BSD as a convenience form for who am i, the Berkeley Unix who command's way of printing just the logged in user's identity. This version was developed by Bill Joy. [2]

The GNU version was written by Richard Mlynarik and is part of the GNU Core Utilities (coreutils).

The command is available as a separate package for Microsoft Windows as part of the GnuWin32 project [3] and the UnxUtils collection of native Win32 ports of common GNU Unix-like utilities. [4]

On Intel iRMX 86 this command lists the currents user's identification and access rights. [5]

The command is also available as part of the Windows 2000 Resource Kit [6] and Windows XP SP2 Support Tools. [7]

The ReactOS version was developed by Ismael Ferreras Morezuelas and is licensed under the GPLv2. [8]

This command was also available as a NetWare-Command residing in the public-directory of the fileserver. It also outputs the current connections to which server the workstation is attached with which username.

Example

Unix, Unix-like

# whoami root

Intel iRMX 86

--WHOAMIUSER ID: 5ACCESS ID'S: 5, WORLD

Windows, ReactOS

C:\Users\admin>whoami workgroup\admin

See also

Related Research Articles

uniq is a utility command on Unix, Plan 9, Inferno, and Unix-like operating systems which, when fed a text file or standard input, outputs the text with adjacent identical lines collapsed to one, unique line of text.

ls Command to list files and directories in Unix and Unix-like operating systems

In computing, ls is a command to list computer files and directories in Unix and Unix-like operating systems. It is specified by POSIX and the Single UNIX Specification.

dir (command) Directory information command on various operating systems

In computing, dir (directory) is a command in various computer operating systems used for computer file and directory listing. It is one of the basic commands to help navigate the file system. The command is usually implemented as an internal command in the command-line interpreter (shell). On some systems, a more graphical representation of the directory structure can be displayed using the tree command.

mkdir Directory creation command on various operating systems

The mkdir command in the Unix, DOS, DR FlexOS, IBM OS/2, Microsoft Windows, and ReactOS operating systems is used to make a new directory. It is also available in the EFI shell and in the PHP scripting language. In DOS, OS/2, Windows and ReactOS, the command is often abbreviated to md.

basename is a standard computer program on Unix and Unix-like operating systems. When basename is given a pathname, it will delete any prefix up to the last slash ('/') character and return the result. basename is described in the Single UNIX Specification and is primarily used in shell scripts.

uname Standard UNIX utility that prints name and other details about the machine

uname is a computer program in Unix and Unix-like computer operating systems that prints the name, version and other details about the current machine and the operating system running on it.

chown Command used on Unix-like systems to change the owner of a file

The command chown, an abbreviation of change owner, is used on Unix and Unix-like operating systems to change the owner of file system files, directories. Unprivileged (regular) users who wish to change the group membership of a file that they own may use chgrp.

The Unix command su, which stands for 'substitute user', is used by a computer user to execute commands with the privileges of another user account. When executed it invokes a shell without changing the current working directory or the user environment.

xargs is a command on Unix and most Unix-like operating systems used to build and execute commands from standard input. It converts input from standard input into arguments to a command.

tr (Unix) Unix text formatting utility

tr is a command in Unix, Plan 9, Inferno, and Unix-like operating systems. It is an abbreviation of translate or transliterate, indicating its operation of replacing or removing specific characters in its input data set.

wc (Unix) Unix command utility

wc is a command in Unix, Plan 9, Inferno, and Unix-like operating systems. The program reads either standard input or a list of computer files and generates one or more of the following statistics: newline count, word count, and byte count. If a list of files is provided, both individual file and total statistics follow.

In computing, kill is a command that is used in several popular operating systems to send signals to running processes.

who (Unix)

The standard Unix command who displays a list of users who are currently logged into the computer.

diff3 is a Unix utility to compare three files and show any differences among them. diff3 can also merge files, implementing a three-way merge.

tail is a program available on Unix, Unix-like systems, FreeDOS and MSX-DOS used to display the tail end of a text file or piped data.

In computing, tee is a command in command-line interpreters (shells) using standard streams which reads standard input and writes it to both standard output and one or more files, effectively duplicating its input. It is primarily used in conjunction with pipes and filters. The command is named after the T-splitter used in plumbing.

yes (Unix) Unix command

yes is a command on Unix and Unix-like operating systems, which outputs an affirmative response, or a user-defined string of text, continuously until killed.

In computing, sleep is a command in Unix, Unix-like and other operating systems that suspends program execution for a specified time.

logname

In computer software, logname is a program in Unix and Unix-like operating systems that prints the name of the user who is currently logged in on the terminal. It usually corresponds to the LOGNAME variable in the system-state environment.

format (command)

In computing, format, a command-line utility that carries out disk formatting. It is a component of various operating systems, including 86-DOS, MS-DOS, IBM PC DOS and OS/2, Microsoft Windows and ReactOS.

References

  1. Microsoft TechNet Whoami article
  2. 2.9.1BSD Manual Page
  3. CoreUtils for Windows
  4. Native Win32 ports of some GNU utilities
  5. iRMX™86 INTRODUCTION AND OPERATOR'S REFERENCE MANUAL For Release 6
  6. Windows 2000 Resource Kit Tool: Whoami.exe
  7. Windows XP Service Pack 2 Support Tools
  8. "Reactos/Reactos". GitHub . 3 January 2022.

Further reading