bash

How do I get the current user's username in Bash?


How do I get the current user's username in Bash? Do I use whoami?


Solution

  • On the command line, enter

    whoami
    

    or

    echo "$USER"