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.

  • Description
  • Syntax
  • Examples
  • Related commands
  • Linux commands help

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

Syntax

whoami [OPTION]

Options

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.