whoami

NAME

whoami - display effective user id

SYNOPSIS

whoami [-s]

DESCRIPTION

The whoami(1) utility displays your effective user identifier (UID). If your effective UID belongs to the system's principal domain, it will be displayed alone. For example:

$ whoami
jcat

where jcat is the login name.

If your effective UID does not belong to the system's principal domain, it will be displayed as a Windows domain name and a login name, separated by a + sign. For example:

$ whoami
dev+jcat

where dev is the domain and jcat is the login name.

The output of the whoami command is equivalent to the value of the shell variable LOGNAME.

The option available for whoami(1) is:

-s
Strip domain name from output. This is equivalent to the value of the shell variable USERNAME.

DIAGNOSTICS

The whoami(1) utility exits 0 on success, and >0 if an error occurs.

NOTES

The whoami(1) utility has been made obsolete by the id(1) utility. It is provided here as a shell script, equivalent to:

id -un

SEE ALSO

id(1)