Name

whoami — stdin  stdout  - file  -- opt  --help  --version

Synopsis

whoami

The whoami command prints the name of the current, effective user. This may differ from your login name (the output of logname) if you’ve used the su command. This example distinguishes whoami from logname:

$ logname
smith
$ whoami
smith

$ su
Password: ********
# logname
smith
# whoami
root

Get Linux Pocket Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.