Command library / whoami
whoami
Show which user account this shell is running as
Reports the identity behind the current session. On its own it just prints DOMAIN\username, but /groups lists every group that account belongs to and /priv lists every privilege its token holds — both are standard first checks after landing a shell.
Practice whoamiUsage
Options and flags
/usershow the user name and security identifier (SID)
/groupslist every group this user account belongs to
/privlist every privilege this user's access token holds
Examples
whoamiJust the current DOMAIN\username — the fastest identity check.
whoami /groupsEvery group this account belongs to — useful for checking what access it should have.
whoami /privEvery privilege this session's token holds — a key check when hunting for privilege-escalation paths.
Common mistakes
The real switch is plural — /groups, not /group. An unrecognised switch like this is simply rejected.