Linux whoami command

Updated: 04/26/2017 by Computer Hope

About whoami

whoami prints the effective user ID.

This command prints the username associated with the current effective user ID.

Running whoami is the same as running the id command with the options -un.

whoami syntax

whoami [OPTION]

Options

--help Display a help message, and exit.
--version Display version information, and exit.

whoami examples

whoami

Displays the name of the user who runs the command.

w — Show who is logged on and what they are doing.
who — Report which users are logged in to the system.