Discussion on whoami and who instructions in linux

  • 2020-05-14 05:51:11
  • OfStack

whoami

Function description:

Display user name

Grammar:

whoami

Supplementary notes:

Displays its own user name. This directive is equivalent to executing the id-un directive

The difference between whoami and who am i

The who command focuses on seeing which users are currently logged on to the machine

The effect of who-m is the same as that of who am i

who am i displays the user name of the actual user, ID, when the user logs in. This command is equivalent to who-m

whoami displays the valid user ID, which is the username of the user currently operating


Command practice:

[test @test ~]$whoami displays the current user name

test

[test @test ~]$who to see which users are currently logged in

root tty1 2013-04-18 19:30

test pts/0 2013-04-18 19:31 (10.0.0.131)

[test @test ~]$who am i displays the user name of the actual user, ID at the time of login

test pts/0 2013-04-18 19:31 (10.0.0.131)

[test@test~]$ who -m

test pts/0 2013-04-18 19:31 (10.0.0.131)


Related articles: