What does the whoami command do?

whoami is a tiny command that prints the username you are currently logged in as. It is one of the first commands many people learn - and it asks a surprisingly deep question.

Using whoami

On Linux and macOS, open a terminal and type whoami, then press enter. It prints your current user. On Windows, the same command works in Command Prompt or PowerShell and can also show your domain.

Add whoami /all on Windows to print groups and privileges for the current user.

Why it exists

Scripts and admins use whoami to confirm which account is running a process, especially after switching users with sudo or su.

The bigger whoami

The command answers a narrow question: which account am I? The internet answers a broader one every time you open a page. findwhoami shows you that answer.

FAQ

What is the difference between whoami and who?

whoami prints only your current effective username; who lists all users currently logged into the system.

Does whoami work in PowerShell?

Yes. whoami works in both PowerShell and Command Prompt on modern Windows.

Don't like what your browser just revealed?

A VPN hides your IP and location from every site you visit.