Users

The whoami command

Tells which user you are working as right now.

Syntax

whoami

Copy-ready examples

$ whoamiWho am I?
$ sudo whoamiCheck that sudo works

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • After switching user with su, whoami returns the new user.

Related commands

FAQ

Why know my user?

Many permission errors come from being the wrong user.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course