O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required