What is the difference between whoami and who am i commands in Unix?

Both the commands whoami and who am i are used to get the user information in Unix.

When we login as root user on the network, then both whoami and who am i commands will show the user as root.

But when any other user let say john logs in remotely and runs su –root, whoami will show root, but who am i will show the original user john.

Read the full book at www.amazon.com
Posted in Unix, Unix Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *