Sample Header Ad - 728x90

Different outputs for `w`, `who`, `whoami` and `id`

10 votes
1 answer
3379 views
In command line platforms online, like for instance the one on Codecademy, when I run for cmd in w who whoami id do echo $cmd $cmd echo ========================= echo " " done I get w                               00:52:54 up 8 days, 14:10,  0 users,  load average: 3.78, 2.98, 2.69       USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT        =========================                             who =========================                                                  whoami                           ccuser                           =========================                                  id uid=1000(ccuser) gid=1000(ccuser) groups=1000(ccuser)      =========================                    Note that only whoami and id output something. When I run the same thing on my computer, I see similar results for all commands. Why doesn't Codecademy display the user for w and who? What's different about these commands?
Asked by whoami (103 rep)
Mar 17, 2019, 01:04 AM
Last activity: Mar 17, 2019, 10:50 AM