Reprinted from https://blog.csdn.net/mahao1107/article/details/46851375
Let's take a look at the difference between these commands:
First of all, the Fire login is the root user. Let's take a look at the difference between these three commands:
Then Fire uses the su command to switch to the normal user, and look at the difference between these three commands:
Summarized as follows:
whoami;显示的是当前用户下的用户名
who am i:显示的是登录时的用户名
who:显示当前真正登录系统中的用户(不会显示那些用su命令切换用户的登录者)