whoami

Find out which user you are working as

What it does

whoami prints the name of the current user. On a server it is the first thing to check after logging in: the user decides which files you can reach and whether you need sudo.

sudo whoami prints root, which shows that a command with sudo runs as the administrator. id tells you more: the user's number and all of their groups.

Syntax

whoami
id

Examples

Related commands

Practise · All commands