Linux whoami command

Updated: 05/04/2019 by Computer Hope
whoami command

On Unix-like operating systems, the whoami command prints the effective user ID. Use it to quickly verify the user as which you are currently logged in.

This page covers the GNU/Linux version of whoami.

Description

whoami prints the username associated with the current effective user ID.

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

Syntax

whoami [OPTION]

Options

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

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.