System Information

whoami

Prints the current effective username.

whoami tells you which user your shell is currently acting as.

Syntax
whoami

Arguments explained

  • No required arguments.

Common examples

Check your user
whoami

Prints a username such as alex or root.

Confirm sudo shell identity
sudo whoami

Usually prints root, showing the command ran with elevated privileges.

whoami Command
FieldDetails
Commandwhoami
CategorySystem Information
Primary usePrints the current effective username.
Syntaxwhoami