Search code examples
linuxbashfedora-25

"who am i" command returns empty prompt


I am following a book on Linux. One of the first commands is to execute who am i. It should return my username. However, it returns an empty prompt.

What am I missing?

I am using Fedora 25.


Solution

  • When you write:

    who am i
    

    You're actually passing two parameters ("am" and "i") to the who command:

    :~$ who --help
    Usage: who [OPTION]... [ FILE | ARG1 ARG2 ]
    

    You want to do (without the spaces; it's a different function):

    whoami
    

    to get what you want.