The man page description of who command is who - show who is logged onBut there exists a similar command whoami. The man page description of whoami is whoami - print effective useridCan anyone explain what exactly these commands do ? How are they different from each other ?
Difference between who and whoami commands
command line;who;whoami
I am logging in as root in my shell and typing who and this is the output. whoroot     tty1         2014-08-25 14:01 (:0)root     pts/0        2014-09-05 10:22 (:0.0)root     pts/3        2014-09-19 10:08 (xxx.xxx.edu)It effectively shows all the users that have established a connection. ssh ramesh@hostnameRunning who again will result in another entry for the user ramesh. whoroot     tty1         2014-08-25 14:01 (:0)root     pts/0        2014-09-05 10:22 (:0.0)root     pts/3        2014-09-19 10:08 (xxx.xxx.edu)ramesh   pts/4        2014-09-19 12:11 (xxx.xxx.edu)Inside the root shell, I just do a su ramesh and then give whoami. It will give me the output as the current user which is ramesh. So effectively with who it gives the list of all users currently logged in to the machine and with whoami you can know the current user who is in the shell.