whoami
Permissions
Usage
whoamiPrints the effective user name rather than the one you logged in as, so inside sudo or su it says root.
Common flags
| Flag | Meaning |
|---|---|
| none | whoami takes no options; it is the same as id -un |
Examples
whoamiThe effective user name.
sudo whoamiPrints root, which is how you check sudo works.
Numeric and symbolic modes name the same thing: 755 and u=rwx,go=rx are the same permission.
How to read this
- Square brackets [ ] mark a part you may leave out.
- An ellipsis … means you can list more than one.
- Flags are case-sensitive — in some commands -r and -R do different things.
Questions
QWhat does whoami do?
Prints the effective user name rather than the one you logged in as, so inside sudo or su it says root.
QHow do I type it?
whoami — square brackets mark the parts you can leave out.
QHow many flags are worth knowing?
1 are listed here; the full set is in man whoami. This command sits under Permissions.
Related commands
man page: man whoami