Print the user name associated with the current effective user ID
whoami [OPTION]...
--help Display help and exit.
--version Display version and exit.
Returns 0 on success and non-zero on failure.
[root@localhost ~]# whoami
root
id -un.whoami vs logname: If you log in as root and then su to user2, whoami will return user2, while logname will still return root.GNU coreutils package. For more help, see man -s 1 whoami.