# who am i returns login name not current user name



## exeter (Jul 20, 2016)

`who am i`returns user1, even though I have switched user to root. How do I get a return of my current user name? Thanks.


----------



## SirDice (Jul 20, 2016)

id(1)?



> `who am i` returns user1, even though I have switched user to root.


Note, there's  a difference between `whoami` and `who am i`:


```
dice@wintermute:~ % id
uid=1001(dice) gid=1001(dice) groups=1001(dice),0(wheel)
dice@wintermute:~ % su -
Password:
root@wintermute:~ # whoami
root
root@wintermute:~ # who am i
dice             pts/2        Jul 20 13:44 (maelcum.dicelan.home)
root@wintermute:~ # id
uid=0(root) gid=0(wheel) groups=0(wheel),5(operator)
root@wintermute:~ #
```


----------



## exeter (Jul 20, 2016)

`id -nu` is the ticket. Thank you for that Sir Dice of FreeBSD.


----------

