I can understand the commands who
and whoami
, but what exactly happens when I type:
who am i
and
who am
I am on Ubuntu, nothing happens after them!
Why doesn't Linux / UNIX reply with an error message (something on the line of "unknown arguments" for who
), or just reply with the output of who
?
Best Answer
If
whoami
doesn’t output anything, it probably indicates that your shell isn’t a login shell. There’s no user associated withwho
’s standard input, sowho
doesn’t output anything — that’s not an error as far as it’s concerned, so it doesn’t output an error message.If you run
to open a terminal with a login shell, you should find that
whoami
andwho am i
work fine. The same goes for a remote login using e.g. SSH.